Fixed _Read() when waitall was not set and there was data in the pushback buffer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guillermo Rodriguez Garcia 2000-03-15 14:35:33 +00:00
parent 7b28543293
commit 5f3629babd

View 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)