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:
parent
7b28543293
commit
5f3629babd
@ -244,8 +244,13 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
|
|||||||
nbytes -= total;
|
nbytes -= total;
|
||||||
buffer = (char *)buffer + total;
|
buffer = (char *)buffer + total;
|
||||||
|
|
||||||
// If the socket is invalid or we got all the data, return now
|
// Return now in one of the following cases:
|
||||||
if (!m_socket || !nbytes)
|
// - 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;
|
return total;
|
||||||
|
|
||||||
// Possible combinations (they are checked in this order)
|
// Possible combinations (they are checked in this order)
|
||||||
|
Loading…
Reference in New Issue
Block a user