--- old/qnetworkproxy_win.cpp 2012-02-29 12:39:10.000000000 -0600 +++ qnetworkproxy_win.cpp 2012-02-29 12:38:08.000000000 -0600 @@ -289,7 +289,7 @@ ptrWinHttpGetIEProxyConfigForCurrentUser = (PtrWinHttpGetIEProxyConfigForCurrentUser)lib.resolve("WinHttpGetIEProxyConfigForCurrentUser"); // Try to obtain the Internet Explorer configuration. - WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ieProxyConfig; + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ieProxyConfig = { 0 }; if (ptrWinHttpGetIEProxyConfigForCurrentUser(&ieProxyConfig)) { if (ieProxyConfig.lpszAutoConfigUrl) { autoConfigUrl = QString::fromWCharArray(ieProxyConfig.lpszAutoConfigUrl); @@ -310,10 +310,6 @@ hHttpSession = NULL; if (ieProxyConfig.fAutoDetect || !autoConfigUrl.isEmpty()) { - // using proxy autoconfiguration - proxyServerList.clear(); - proxyBypass.clear(); - // open the handle and obtain the options hHttpSession = ptrWinHttpOpen(L"Qt System Proxy access/1.0", WINHTTP_ACCESS_TYPE_NO_PROXY, @@ -330,8 +326,10 @@ autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; autoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A; - } else { - autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; + } + if (!autoConfigUrl.isEmpty()) + { + autoProxyOptions.dwFlags |= WINHTTP_AUTOPROXY_CONFIG_URL; autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)autoConfigUrl.utf16(); } } else { @@ -417,13 +415,11 @@ // GetProxyForUrl failed - if (ERROR_WINHTTP_AUTODETECTION_FAILED == getProxyError) { + if (!getProxySucceeded) { //No config file could be retrieved on the network. //Don't search for it next time again. sp->isAutoConfig = false; } - - return sp->defaultResult; } // static configuration