QNativeSocketEngine/Win: fix write() in case of splitting
When a first call to ::WSASend() consumes less data than requested, we are trying to make a second call, leaving 'bytesToSend' unmodified. Instead of setting a new value for 'bytesToSend', it seems reasonable to break the loop, if the system buffer overflow detected. Pick-to: 5.15 Change-Id: I8038e95c20221518955efe786f2d0dadb98360fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
30395e9185
commit
83f00b8229
@ -1444,10 +1444,8 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
|
||||
|
||||
int err;
|
||||
if (socketRet != SOCKET_ERROR) {
|
||||
if (ret == len)
|
||||
if (ret == len || bytesToSend != qint64(bytesWritten))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
} else if ((err = WSAGetLastError()) == WSAEWOULDBLOCK) {
|
||||
break;
|
||||
} else if (err == WSAENOBUFS) {
|
||||
|
Loading…
Reference in New Issue
Block a user