diff options
author | Peter Hartmann <phartmann@blackberry.com> | 2013-06-13 11:53:35 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-18 13:41:03 +0200 |
commit | 75e9c7d6bc662e62e9ce8b641588183992c1e8bf (patch) | |
tree | 6d43ede02107f20413182a0e23427220ff824ce1 | |
parent | 36d42a0edee32363628d238fe45d53895d5b4411 (diff) |
HTTP internals: consider SSL sockets with pending encryption as usable
We do not decide which socket a HTTP request is sent on until the
socket is actually ready for sending a request (i.e. it is connected
for HTTP requests and encryption is done for HTTPS requests).
When deciding how many sockets we need for the queued requests, we
consider an in-flight socket as free if it is still connecting.
However, we considered a socket that was connected but needed to
complete encryption as busy, and would instead open another socket.
Now, we consider an encrypting socket as in-flight as well.
Change-Id: I93d6743da6fc430d1424c6965e1475865fd97243
Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 4 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index a279990f4c..5c3c38606d 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -929,7 +929,9 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() for (int i = 0; i < channelCount; ++i) { bool connectChannel = false; if (channels[i].socket) { - if ((channels[i].socket->state() == QAbstractSocket::ConnectingState) || (channels[i].socket->state() == QAbstractSocket::HostLookupState)) + if ((channels[i].socket->state() == QAbstractSocket::ConnectingState) + || (channels[i].socket->state() == QAbstractSocket::HostLookupState) + || channels[i].pendingEncrypt) // pendingEncrypt == "EncryptingState" queuedRequest--; if ( queuedRequest <=0 ) break; diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 53436b1769..a756f22937 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -183,6 +183,9 @@ void QHttpNetworkConnectionChannel::close() else state = QHttpNetworkConnectionChannel::ClosingState; + // pendingEncrypt must only be true in between connected and encrypted states + pendingEncrypt = false; + if (socket) socket->close(); } |