summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnection.cpp
diff options
context:
space:
mode:
authorMandeep Sandhu <mandeepsandhu.chd@gmail.com>2013-09-17 13:04:39 +0530
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-29 16:44:04 +0200
commitf30641a7f8c3e38859a6f05a2c190496338b7e7d (patch)
tree4c2964699d243098d1b918bb6972f39f3719b35a /src/network/access/qhttpnetworkconnection.cpp
parent0f3315a4dd843bfd21c398bb077364268eb967e3 (diff)
Fix error signal supression for failed DNS lookups
Sometimes the signal QNetworkReply::error(QNetworkReply::NetworkError) is not emitted for certain requests. This happens under the following conditions: * The hostname provided in the request is incorrect, i.e it will result in a DNS lookup failure. * There is a previous request, for the _same_ host, already pending. The first request that comes for the (incorrect hostname) url, gets enqueued via QHttpNetworkConnectionPrivate::queueRequest(). Here, after starting a DNS lookup, we mark the network state of this connection as - "InProgress". Now, if a second reuest comes for the same host, we use the existing HTTP connection object as it's present in the cache. However, when enqueing the request (in queueRequest()), we see that the network is NOT in "Unknown" state and return immediately without adding this new request to the list of pending lookups (via QHostInfo::lookupHost()). To fix this issue, we should queue incoming lookup requests, even if the current (HTTP) connection is in the "InProgress" state, so that we can inform the requestor of a failed lookup. Since QHostInfo::lookupHost() handles lookups for duplicate hostnames properly, things should be fine even if multiple requests for the same host have been enqueued. Task-number: QTBUG-32911 Change-Id: I6a9c8430121e9a5a2d45983b6bda70c324437992 Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index b6a3b5e3ab..ba9e5cbdc4 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -560,7 +560,7 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
// untill we have started the first connection attempt. So no
// request will be started untill we know if IPv4 or IPv6
// should be used.
- if (networkLayerState == Unknown) {
+ if (networkLayerState == Unknown || networkLayerState == InProgress) {
startHostInfoLookup();
} else if ( networkLayerState == IPv4 || networkLayerState == IPv6 ) {
// this used to be called via invokeMethod and a QueuedConnection