X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fsocket_handler.cpp;h=f2ddcb6a4b6abd9ccabc1f2645b6af9da133738b;hp=6f9df0770c00b10b8299e650c7d65453362cb3e3;hb=07e98688a1a8c3e915ce923f79261a88251a9edd;hpb=644c4d262aab14ee4ec1cfade83a2e99568098d3 diff --git a/src/socket_handler.cpp b/src/socket_handler.cpp index 6f9df07..f2ddcb6 100644 --- a/src/socket_handler.cpp +++ b/src/socket_handler.cpp @@ -149,8 +149,8 @@ bool socket_handler::data_waiting(long long usec_timeout) bool socket_handler::fill_buffer(std::string& buffer, long long usec_timeout) { - // fast path for timeout==-1 - if (usec_timeout==-1 || data_waiting(usec_timeout)) + // fast path for timeout==0 + if (usec_timeout==0 || data_waiting(usec_timeout)) return fill_buffer(buffer); else return false; @@ -192,7 +192,7 @@ bool socket_handler::fill_buffer(std::string& buffer) buffer.assign(socket_buffer,nbytes); // more data waiting -> recurse - if (data_waiting()) + if (data_waiting(0)) fill_buffer(buffer); if (nbytes > 0)