diff --git a/docs/changes.txt b/docs/changes.txt index d0ec88bfb5..405a87cb06 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -73,7 +73,8 @@ All: the first time it was called. - Added wxString::rbegin() and rend() - 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): diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 048fe30407..080518cd0e 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -330,11 +330,9 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 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. + // - we got all the data if ( !m_socket || - !nbytes || - ((total != 0) && !(m_flags & wxSOCKET_WAITALL)) ) + !nbytes ) return total; // Possible combinations (they are checked in this order)