diff options
Diffstat (limited to 'src/network/ssl/qsslsocket.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 0e4b049353..9b62240767 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -2015,7 +2015,10 @@ qint64 QSslSocket::writeData(const char *data, qint64 len) d->writeBuffer.append(data, len); // make sure we flush to the plain socket's buffer - QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection); + if (!d->flushTriggered) { + d->flushTriggered = true; + QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection); + } return len; } @@ -2034,6 +2037,7 @@ QSslSocketPrivate::QSslSocketPrivate() , allowRootCertOnDemandLoading(true) , plainSocket(0) , paused(false) + , flushTriggered(false) { QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration); } @@ -2056,6 +2060,7 @@ void QSslSocketPrivate::init() ignoreAllSslErrors = false; shutdown = false; pendingClose = false; + flushTriggered = false; // we don't want to clear the ignoreErrorsList, so // that it is possible setting it before connecting @@ -2512,6 +2517,10 @@ void QSslSocketPrivate::_q_channelBytesWrittenSlot(int channel, qint64 written) void QSslSocketPrivate::_q_flushWriteBuffer() { Q_Q(QSslSocket); + + // need to notice if knock-on effects of this flush (e.g. a readReady() via transmit()) + // make another necessary, so clear flag before calling: + flushTriggered = false; if (!writeBuffer.isEmpty()) q->flush(); } |