summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-01-11 18:49:43 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-01-11 18:49:43 (GMT)
commit3efc651f6695ec224374bf29ad5b695a8e492a65 (patch)
treeccf6548e1600d8d86e0a1a3acaa541edd72da668 /src/network/access
parent1b1aab443117f818914ed2434a5ea7a1002d4cc9 (diff)
downloadQt-3efc651f6695ec224374bf29ad5b695a8e492a65.zip
Qt-3efc651f6695ec224374bf29ad5b695a8e492a65.tar.gz
Qt-3efc651f6695ec224374bf29ad5b695a8e492a65.tar.bz2
QNAM HTTP Code: Cache socket state inside ensureConnection()
Reviewed-by: TrustMe
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index da305a0..39d09aa 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -432,21 +432,23 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
bool QHttpNetworkConnectionChannel::ensureConnection()
{
+ QAbstractSocket::SocketState socketState = socket->state();
+
// resend this request after we receive the disconnected signal
- if (socket->state() == QAbstractSocket::ClosingState) {
+ if (socketState == QAbstractSocket::ClosingState) {
resendCurrent = true;
return false;
}
// already trying to connect?
- if (socket->state() == QAbstractSocket::HostLookupState ||
- socket->state() == QAbstractSocket::ConnectingState) {
+ if (socketState == QAbstractSocket::HostLookupState ||
+ socketState == QAbstractSocket::ConnectingState) {
return false;
}
// make sure that this socket is in a connected state, if not initiate
// connection to the host.
- if (socket->state() != QAbstractSocket::ConnectedState) {
+ if (socketState != QAbstractSocket::ConnectedState) {
// connect to the host if not already connected.
state = QHttpNetworkConnectionChannel::ConnectingState;
pendingEncrypt = connection->d_func()->encrypt;