From acc134c8ea5f756dd605d0de50ca1a263383de2d Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 13 Apr 2017 12:10:04 +0200 Subject: 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 --- src/network/access/qhttpnetworkconnection.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/network/access/qhttpnetworkconnection.cpp') 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. -- cgit v1.2.3