summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qsslsocket.cpp')
-rw-r--r--src/network/ssl/qsslsocket.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 27b085ddbd..8887f478dd 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1908,18 +1908,14 @@ qint64 QSslSocket::readData(char *data, qint64 maxlen)
if (d->mode == UnencryptedMode && !d->autoStartHandshake) {
readBytes = d->plainSocket->read(data, maxlen);
- } else {
- int bytesToRead = qMin<int>(maxlen, d->buffer.size());
- readBytes = d->buffer.read(data, bytesToRead);
- }
-
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocket::readData(" << (void *)data << ',' << maxlen << ") ==" << readBytes;
+ qDebug() << "QSslSocket::readData(" << (void *)data << ',' << maxlen << ") =="
+ << readBytes;
#endif
-
- // possibly trigger another transmit() to decrypt more data from the socket
- if (d->buffer.isEmpty() && d->plainSocket->bytesAvailable()) {
- QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection);
+ } else {
+ // possibly trigger another transmit() to decrypt more data from the socket
+ if (d->plainSocket->bytesAvailable())
+ QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection);
}
return readBytes;