summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket.cpp
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2020-12-04 12:01:03 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-04 18:29:41 +0000
commite9eb05b5b7de22521dc23aabadf90ec903e042da (patch)
tree9315d8c194a0fcbd473d1cccc4a931771787b55b /src/network/ssl/qsslsocket.cpp
parentfc794d7622e11a8538d146f4e64dbce9f6287cd6 (diff)
QSslSocket: Don't call 'transmit' in unencrypted mode
At the same time I'll add a generic protection against being called in unprotected mode in the schannel backend (openssl already has it in a different form). Change-Id: I97c1be6239c27e306de0af7ad568fbcfde09da71 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit f8badeda72813ee4d32e7672c4a98373cb7b5d60) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/network/ssl/qsslsocket.cpp')
-rw-r--r--src/network/ssl/qsslsocket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index c5444b139e..a7c6b16b19 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -2326,7 +2326,7 @@ void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error)
qCDebug(lcSsl) << "\terrorString =" << q->errorString();
#endif
// this moves encrypted bytes from plain socket into our buffer
- if (plainSocket->bytesAvailable()) {
+ if (plainSocket->bytesAvailable() && mode != QSslSocket::UnencryptedMode) {
qint64 tmpReadBufferMaxSize = readBufferMaxSize;
readBufferMaxSize = 0; // reset temporarily so the plain sockets completely drained drained
transmit();