diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2012-10-26 12:28:31 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2012-10-26 12:28:53 +0200 |
commit | 6e5818f2bbc8443b9308252a5e1543e014ef439d (patch) | |
tree | 07922adee2f13e818b9439c8a0bdf871dda59039 /src/network | |
parent | 32aac0a1c009ee940920fd12f277180dd80b8eff (diff) | |
parent | deac55becd18efa4504eb686a1bb8081a5cd488a (diff) |
Merge remote-tracking branch 'gerrit/master' into newdocs
Change-Id: I10cf9f915c602c8e5a0e7d7c9e17b7bc5ca00640
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 42 | ||||
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 4 | ||||
-rw-r--r-- | src/network/kernel/qdnslookup.h | 2 | ||||
-rw-r--r-- | src/network/network.pro | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 8 |
5 files changed, 27 insertions, 31 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index a3e46d8cd2..51076c6c22 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1025,31 +1025,29 @@ void QHttpNetworkConnectionChannel::_q_disconnected() void QHttpNetworkConnectionChannel::_q_connected() { // For the Happy Eyeballs we need to check if this is the first channel to connect. - if (!pendingEncrypt) { - if (connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::InProgress) { - if (connection->d_func()->delayedConnectionTimer.isActive()) - connection->d_func()->delayedConnectionTimer.stop(); - if (networkLayerPreference == QAbstractSocket::IPv4Protocol) + if (connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::InProgress) { + if (connection->d_func()->delayedConnectionTimer.isActive()) + connection->d_func()->delayedConnectionTimer.stop(); + if (networkLayerPreference == QAbstractSocket::IPv4Protocol) + connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4; + else if (networkLayerPreference == QAbstractSocket::IPv6Protocol) + connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; + else { + if (socket->peerAddress().protocol() == QAbstractSocket::IPv4Protocol) connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4; - else if (networkLayerPreference == QAbstractSocket::IPv6Protocol) + else connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; - else { - if (socket->peerAddress().protocol() == QAbstractSocket::IPv4Protocol) - connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4; - else - connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; - } - connection->d_func()->networkLayerDetected(networkLayerPreference); - } else { - if (((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv4) && (networkLayerPreference != QAbstractSocket::IPv4Protocol)) - || ((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv6) && (networkLayerPreference != QAbstractSocket::IPv6Protocol))) { - close(); - // This is the second connection so it has to be closed and we can schedule it for another request. - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); - return; - } - //The connections networkLayerState had already been decided. } + connection->d_func()->networkLayerDetected(networkLayerPreference); + } else { + if (((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv4) && (networkLayerPreference != QAbstractSocket::IPv4Protocol)) + || ((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv6) && (networkLayerPreference != QAbstractSocket::IPv6Protocol))) { + close(); + // This is the second connection so it has to be closed and we can schedule it for another request. + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); + return; + } + //The connections networkLayerState had already been decided. } // improve performance since we get the request sent by the kernel ASAP diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 3dcb4b8730..1118c3242f 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -205,10 +205,10 @@ static void ensureInitialized() QNetworkAccessManager gained the ability to manage network connections. QNetworkAccessManager can start the network interface if the device is offline and terminates the interface if the current process is the last - one to use the uplink. Note that some platform utilize grace periods from + one to use the uplink. Note that some platforms utilize grace periods from when the last application stops using a uplink until the system actually terminates the connectivity link. Roaming is equally transparent. Any - queued/pending network requests are automatically transferred to new + queued/pending network requests are automatically transferred to the new access point. Clients wanting to utilize this feature should not require any changes. In fact diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h index 84e5fcfb03..5218c2618a 100644 --- a/src/network/kernel/qdnslookup.h +++ b/src/network/kernel/qdnslookup.h @@ -52,8 +52,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Network) - class QHostAddress; class QDnsLookupPrivate; class QDnsDomainNameRecordPrivate; diff --git a/src/network/network.pro b/src/network/network.pro index 09791d7f6d..d2b2447611 100644 --- a/src/network/network.pro +++ b/src/network/network.pro @@ -1,5 +1,3 @@ -load(qt_build_config) - TARGET = QtNetwork QT = core-private diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 8260c1c563..e97cf0817a 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -2153,11 +2153,13 @@ void QSslSocketPrivate::_q_connectedSlot() qDebug() << "\tlocal =" << QHostInfo::fromName(q->localAddress().toString()).hostName() << q->localAddress() << q->localPort(); #endif - emit q->connected(); - if (autoStartHandshake) { + if (autoStartHandshake) q->startClientEncryption(); - } else if (pendingClose) { + + emit q->connected(); + + if (pendingClose && !autoStartHandshake) { pendingClose = false; q->disconnectFromHost(); } |