Windows - handle proxy autoconfiguration resulting in no proxy
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Wed, 22 Feb 2012 20:20:27 +0000 (20:20 +0000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 8 Mar 2012 04:31:40 +0000 (05:31 +0100)
The PAC file may result in direct connection, in which case
WinHttp returns null strings for the proxies and the connection
type marked as direct.
In this case, return the default list (no proxy)

Change-Id: I601033f56a841bb92ea80a28174bb993b024ad79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/network/kernel/qnetworkproxy_win.cpp

index 37c0cc4..324f3cc 100644 (file)
@@ -417,6 +417,8 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
             if (proxyInfo.lpszProxyBypass)
                 GlobalFree(proxyInfo.lpszProxyBypass);
 
+            if (proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NO_PROXY)
+                return sp->defaultResult; //i.e. the PAC file result was "DIRECT"
             if (isBypassed(query.peerHostName(), splitSpaceSemicolon(proxyBypass)))
                 return sp->defaultResult;
             return parseServerList(query, proxyServerList);