Continue reading after checking the pushback buffer if more data is requested. Otherwise, once any data if placed in the pushback buffer, no more data will be read from the socket, even if more data is requested.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Hock
2006-05-14 19:49:19 +00:00
parent 4ce04fd883
commit 635f2bad90
2 changed files with 4 additions and 5 deletions

View File

@@ -73,7 +73,8 @@ All:
the first time it was called. the first time it was called.
- Added wxString::rbegin() and rend() - Added wxString::rbegin() and rend()
- Added wxString::EndsWith() - Added wxString::EndsWith()
- wxSocket::_Read continues reading from socket after exhausting pushback buffer.
Previously, only the buffer would be returned, even if more data was requested.
All (GUI): All (GUI):

View File

@@ -330,11 +330,9 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
// Return now in one of the following cases: // Return now in one of the following cases:
// - the socket is invalid, // - the socket is invalid,
// - we got all the data, // - we got all the data
// - we got *some* data and we are not using wxSOCKET_WAITALL.
if ( !m_socket || if ( !m_socket ||
!nbytes || !nbytes )
((total != 0) && !(m_flags & wxSOCKET_WAITALL)) )
return total; return total;
// Possible combinations (they are checked in this order) // Possible combinations (they are checked in this order)