Schannel: Fix readBufferMaxSize impl with incomplete data optimization

Following the incomplete data guesstimation optimization the
tst_QSslSocket::readBufferMaxSize test would fail due to it waiting for
16K, but the readBufferMaxSize was 10 bytes.

Amends 559b563d71

Change-Id: I5d17fac24e73c1305161aff744710b4c5b0b457a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2020-03-09 12:03:06 +01:00
parent d52a553754
commit d340cc1512

View File

@ -1312,7 +1312,8 @@ void QSslSocketBackendPrivate::transmit()
int totalRead = 0;
bool hadIncompleteData = false;
while (!readBufferMaxSize || buffer.size() < readBufferMaxSize) {
if (missingData > plainSocket->bytesAvailable()) {
if (missingData > plainSocket->bytesAvailable()
&& (!readBufferMaxSize || readBufferMaxSize >= missingData)) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl, "We're still missing %lld bytes, will check later.", missingData);
#endif