From: g0dil Date: Tue, 4 May 2010 22:12:35 +0000 (+0000) Subject: Socket: Fix extra available() call in readfrom() X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=6647a9d6691b69d1fc0d744c86177555ead5565d;p=senf.git Socket: Fix extra available() call in readfrom() git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1618 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Socket/ClientSocketHandle.ct b/senf/Socket/ClientSocketHandle.ct index 4a22c91..8bcde15 100644 --- a/senf/Socket/ClientSocketHandle.ct +++ b/senf/Socket/ClientSocketHandle.ct @@ -130,10 +130,9 @@ template prefix_ void senf::ClientSocketHandle::readfrom(Sequence & container, Address & from, unsigned limit) { - unsigned nread (available()); - if (limit>0 && nread>limit) - nread = limit; - container.resize(nread); + if (limit == 0) + limit = available(); + container.resize(limit); container.erase(readfrom( std::make_pair(container.begin(), container.end()), from ), container.end()); }