diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 15 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.h | 1 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_p.h | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index ad766c1..2c88130 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1740,6 +1740,11 @@ qint64 QSslSocket::readData(char *data, qint64 maxlen) #ifdef QSSLSOCKET_DEBUG qDebug() << "QSslSocket::readData(" << (void *)data << ',' << maxlen << ") ==" << readBytes; #endif + + // possibly trigger another transmit() to decrypt more data from the socket + if (d->readBuffer.isEmpty() && d->plainSocket->bytesAvailable()) + QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection); + return readBytes; } @@ -2134,6 +2139,16 @@ void QSslSocketPrivate::_q_flushWriteBuffer() q->flush(); } +/*! + \internal +*/ +void QSslSocketPrivate::_q_flushReadBuffer() +{ + // trigger a read from the plainSocket into SSL + if (mode != QSslSocket::UnencryptedMode) + transmit(); +} + QT_END_NAMESPACE // For private slots diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index adb206c..82cda35 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -207,6 +207,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_readyReadSlot()) Q_PRIVATE_SLOT(d_func(), void _q_bytesWrittenSlot(qint64)) Q_PRIVATE_SLOT(d_func(), void _q_flushWriteBuffer()) + Q_PRIVATE_SLOT(d_func(), void _q_flushReadBuffer()) friend class QSslSocketBackendPrivate; }; diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 24d4ebe..ee21956 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -120,6 +120,7 @@ public: void _q_readyReadSlot(); void _q_bytesWrittenSlot(qint64); void _q_flushWriteBuffer(); + void _q_flushReadBuffer(); // Platform specific functions virtual void startClientEncryption() = 0; |