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.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 27b085ddbd..06d85de91b 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;
@@ -2127,10 +2123,8 @@ void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPri
QMutexLocker locker(&globalData()->mutex);
const QSslConfigurationPrivate *global = globalData()->config.constData();
- if (!global) {
- ptr = 0;
+ if (!global)
return;
- }
ptr->ref.store(1);
ptr->peerCertificate = global->peerCertificate;