From: tho Date: Mon, 15 Jun 2009 14:55:47 +0000 (+0000) Subject: Socket: fixed bug in readfrom where socklen was not set X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=6927c87144ca23845065e3c23e37c75f5f059cf3;p=senf.git Socket: fixed bug in readfrom where socklen was not set git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1232 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/ReadWritePolicy.cc b/Socket/ReadWritePolicy.cc index c842604..9ca08ad 100644 --- a/Socket/ReadWritePolicy.cc +++ b/Socket/ReadWritePolicy.cc @@ -61,11 +61,11 @@ prefix_ unsigned senf::ReadablePolicy::read(FileHandle handle, char * buffer, prefix_ unsigned senf::ReadablePolicy::do_readfrom(FileHandle handle, char * buffer, unsigned size, - struct ::sockaddr * addr, socklen_t len) + struct ::sockaddr * addr, socklen_t * len) { int rv = -1; do { - rv = ::recvfrom(handle.fd(),buffer, size, 0, addr, &len); + rv = ::recvfrom(handle.fd(),buffer, size, 0, addr, len); if (rv < 0) switch (errno) { case EINTR: diff --git a/Socket/ReadWritePolicy.cti b/Socket/ReadWritePolicy.cti index 618c2d3..edb7915 100644 --- a/Socket/ReadWritePolicy.cti +++ b/Socket/ReadWritePolicy.cti @@ -38,7 +38,7 @@ readfrom(ClientSocketHandle handle, char * buffer, unsigned size, typename SPolicy::AddressingPolicy::Address & address, typename IfCommunicationPolicyIs::type *) { - return do_readfrom(handle, buffer, size, address.sockaddr_p(), address.socklen()); + return do_readfrom(handle, buffer, size, address.sockaddr_p(), address.socklen_p()); } #else template diff --git a/Socket/ReadWritePolicy.hh b/Socket/ReadWritePolicy.hh index 023b3f6..24d5cea 100644 --- a/Socket/ReadWritePolicy.hh +++ b/Socket/ReadWritePolicy.hh @@ -78,7 +78,7 @@ namespace senf { private: static unsigned do_readfrom(FileHandle handle, char * buffer, unsigned size, - struct ::sockaddr * addr, socklen_t len); + struct ::sockaddr * addr, socklen_t * len); }; /** \brief ReadPolicy for unreadable sockets