diff options
author | Martin Petersson <Martin.Petersson@nokia.com> | 2012-05-30 17:03:57 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-26 11:32:04 +0200 |
commit | bf6897edb01c0d46fda5195e36bb529dbbf7e5dc (patch) | |
tree | e2f0a207baf8ec6ea0aa7d3374e44c468f9d0651 /src/network/ssl/qsslsocket_openssl.cpp | |
parent | 9e66ee2d59d28d61e06e5c57485f1a331b82f269 (diff) |
QtNetwork: remove double buffering on sockets
Removes the readBuffer from the QAbstractSocket since data is already
buffered in the QIODevice.
Change-Id: I4e50b791fd2852455e526fa2c07089d4d3f0b2a4
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket_openssl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 38368583ff..83071f2c7a 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -953,12 +953,13 @@ void QSslSocketBackendPrivate::transmit() } // Check if we've got any data to be read from the socket. - if (!connectionEncrypted || !readBufferMaxSize || readBuffer.size() < readBufferMaxSize) + if (!connectionEncrypted || !readBufferMaxSize || buffer.size() < readBufferMaxSize) while ((pendingBytes = plainSocket->bytesAvailable()) > 0) { // Read encrypted data from the socket into a buffer. data.resize(pendingBytes); // just peek() here because q_BIO_write could write less data than expected int encryptedBytesRead = plainSocket->peek(data.data(), pendingBytes); + #ifdef QSSLSOCKET_DEBUG qDebug() << "QSslSocketBackendPrivate::transmit: read" << encryptedBytesRead << "encrypted bytes from the socket"; #endif @@ -1025,7 +1026,7 @@ void QSslSocketBackendPrivate::transmit() #ifdef QSSLSOCKET_DEBUG qDebug() << "QSslSocketBackendPrivate::transmit: decrypted" << readBytes << "bytes"; #endif - char *ptr = readBuffer.reserve(readBytes); + char *ptr = buffer.reserve(readBytes); ::memcpy(ptr, data.data(), readBytes); if (readyReadEmittedPointer) |