summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnection.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2017-04-13 12:10:04 +0200
committerOliver Wolff <oliver.wolff@qt.io>2017-05-18 05:18:47 +0000
commitacc134c8ea5f756dd605d0de50ca1a263383de2d (patch)
tree70b8604cbd3cf4870c4866bf4cae7f7994cbc225 /src/network/access/qhttpnetworkconnection.cpp
parent1eea9e60d042f2580080e7939d776bc866dc4e0e (diff)
winrt: Skip host lookup for http connections
While QAbstractSocket is already changed in a way that winrt only connects to host names and does not do IP lookups, http connections still do a lookup to check, whether to use IPv4 or IPv6. As this information is not needed on winrt anyways and hostnames are to be preferred over IP addresses on winrt (automatic lookup & proxy handling internally), we skip the lookup for http as well. Task-number: QTBUG-59989 Change-Id: Ibc11f5ac07faf23e7af508fd20ee4880b24f79a8 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index da055de2da..ae30d3a8cf 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -644,6 +644,7 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
channels[0].spdyRequestsToSend.insertMulti(request.priority(), pair);
}
+#ifndef Q_OS_WINRT
// For Happy Eyeballs the networkLayerState is set to Unknown
// untill we have started the first connection attempt. So no
// request will be started untill we know if IPv4 or IPv6
@@ -651,6 +652,13 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
if (networkLayerState == Unknown || networkLayerState == HostLookupPending) {
startHostInfoLookup();
} else if ( networkLayerState == IPv4 || networkLayerState == IPv6 ) {
+#else // !Q_OS_WINRT
+ {
+ // Skip the host lookup part for winrt. Host lookup and proxy handling are done by Windows
+ // internally and networkLayerPreference is ignored on this platform. Instead of refactoring
+ // the whole approach we just pretend that everything important is known here.
+ networkLayerState = IPv4;
+#endif
// this used to be called via invokeMethod and a QueuedConnection
// It is the only place _q_startNextRequest is called directly without going
// through the event loop using a QueuedConnection.