git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6734
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
nbytes -= total;
buffer = (char *)buffer + total;
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)
return total;
// Possible combinations (they are checked in this order)