diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-10-17 19:24:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-21 17:35:00 +0200 |
commit | 690cf426f3a8c18d903e61228f65fa3b9e2a69d3 (patch) | |
tree | 42c3afb155a145ec2f01a20ae87446e9496da673 /src/network/access/qhttpnetworkconnectionchannel.cpp | |
parent | 13035f7fd648c3c4217620695aae033dfbf37b8a (diff) |
Fix Q_ASSERT(!channels[0].isSocketBusy());v5.2.0-beta1
Since commit f30641a7 is has been possible to issue more than one host
lookup request per HttpNetworkConnection. If the result was both an
IPv4 and IPv6 address, and we get a second similar DNS reply, we
end up triggering the assert in startNetworkLayerStateLookup().
This patch splits the InProgress state to HostLookupPending and the state
of trying both IPv4 and IPv6. This makes it possible to ignore any new DNS
replies received after the first succesfull one.
Change-Id: I0b8d6b1582fdaed69dde5926019b60bb0cbd580d
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index da82fdf8d2..6e786893ed 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1045,7 +1045,7 @@ 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 (connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::InProgress) { + if (connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::HostLookupPending || connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv4or6) { if (connection->d_func()->delayedConnectionTimer.isActive()) connection->d_func()->delayedConnectionTimer.stop(); if (networkLayerPreference == QAbstractSocket::IPv4Protocol) @@ -1212,7 +1212,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket QPointer<QHttpNetworkConnection> that = connection; QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString()); - // In the InProgress state the channel should not emit the error. + // In the HostLookupPending state the channel should not emit the error. // This will instead be handled by the connection. if (!connection->d_func()->shouldEmitChannelError(socket)) return; |