summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-03-09 12:03:06 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2020-03-10 09:28:56 +0100
commitd340cc1512a9bf62d824c33c592358699593c6bb (patch)
tree949973d8e0e0144c48ff77585dd5262aeb20677f /src
parentd52a5537548a8df81b5cfcb74d040ee783fe7c55 (diff)
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 559b563d711db0760a51b0dce26536dbc8766a9d Change-Id: I5d17fac24e73c1305161aff744710b4c5b0b457a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/ssl/qsslsocket_schannel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp
index 31b0db4818..e47fda17ab 100644
--- a/src/network/ssl/qsslsocket_schannel.cpp
+++ b/src/network/ssl/qsslsocket_schannel.cpp
@@ -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