]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed _Read() when waitall was not set and there was data in the pushback buffer
authorGuillermo Rodriguez Garcia <guille@iies.es>
Wed, 15 Mar 2000 14:35:33 +0000 (14:35 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Wed, 15 Mar 2000 14:35:33 +0000 (14:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/socket.cpp

index fa5da952460693264397944680d26e66623fa2d3..5036742c4d37d24dad94859e4445bcb972511dd5 100644 (file)
@@ -244,8 +244,13 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
   nbytes -= total;
   buffer  = (char *)buffer + total;
 
-  // If the socket is invalid or we got all the data, return now
-  if (!m_socket || !nbytes)
+  // Return now in one of the following cases:
+  // - the socket is invalid,
+  // - we got all the data,
+  // - we got *some* data and we are not using wxSOCKET_WAITALL.
+  if ( !m_socket ||
+       !nbytes ||
+       ((total != 0) && !(m_flags & wxSOCKET_WAITALL)) )
     return total;
 
   // Possible combinations (they are checked in this order)