X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FSocket%2FClientSocketHandle.ct;h=8bcde15631f314c2118da4b441c6165693081f71;hb=c505c034e5fdc932c02aa3dc3847a5551011d87e;hp=5fc331f8e0b56f655edf6a1b148c6f322cc7d044;hpb=26610f603ebdd465307b9621f532c1fe19fd5571;p=senf.git diff --git a/senf/Socket/ClientSocketHandle.ct b/senf/Socket/ClientSocketHandle.ct index 5fc331f..8bcde15 100644 --- a/senf/Socket/ClientSocketHandle.ct +++ b/senf/Socket/ClientSocketHandle.ct @@ -106,10 +106,10 @@ template template prefix_ void senf::ClientSocketHandle::read(Sequence & container, unsigned limit) { - if (limit == 0) + if (limit == 0) limit = available(); container.resize(limit); - container.erase(read( std::make_pair(container.begin(), container.end()) ), + container.erase(read( std::make_pair(container.begin(), container.end()) ), container.end()); } @@ -130,11 +130,10 @@ 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); - container.erase(readfrom( std::make_pair(container.begin(), container.end()), from ), + if (limit == 0) + limit = available(); + container.resize(limit); + container.erase(readfrom( std::make_pair(container.begin(), container.end()), from ), container.end()); }