Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
4.8.4, 5.0.0
-
None
-
Windows 7 64bit, MS Visual Studio 2010, Customer Portal Case 00305467
Windows Vista, VS 2008
Description
I am developing a Qt 5 based system tray application which uses QNetworkAccessManager for HTTPS requests to a backend server.
I also have added support of using the Windows system proxy settings which may be used by our customers.
It seems that the system proxy settings could only be read once at first time usage only. But if the proxy settings change while my systray application is still running (eg. a user just suspends his/her notebook and changes network configuration after flight in another office, or VPN).
I have drilled down where the system proxy is read:
void QWindowsSystemProxy::init()
{
if (initialized)
return;
initialized = true;
#ifdef Q_OS_WINCE
// Windows CE does not have any of the following API
return;
#else
// load the winhttp.dll library
QSystemLibrary lib(L"winhttp");
if (!lib.load())
return; // failed to load
...
It seems to me that the initialized variable could not be turned back to false, so the cached values still will be used.
In my system tray application I have tried different things to force Qt to update to the current system proxy settings of Windows, but still failed.
Even before every QNetworkRequest get() call the following calls
QNetworkProxyFactory::setUseSystemConfiguration(false); // use current system proxy settings, so we have to call it again and again
QNetworkProxyFactory::setUseSystemConfiguration(true); // use current system proxy settings, so we have to call it again and again
did not make any difference.
My test scenario was:
1. start my Qt application which does a network request every three seconds
2. start Fiddler -> the request of the Qt app does not appear in Fiddler.
3. stop Qt application
4. start Qt application again
5. now the Requests appear in Fiddler.
6. stop Fiddler
7. my Qt application now gets errors that the proxy does not respond.
In a Browser (eg. Firefox) the proxy settings seem to be read more often so that someone could change the proxy settings without a trouble in his/her HTTP application.
How could it be done with Qt5?
Attachments
Issue Links
- depends on
-
QTBUG-10106 Figuring out the why proxy lookup takes long on windows
-
- Reported
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-29990 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
104616,5 | Win32: Re-init system proxy if internet settings change | dev | qt/qtbase | Status: MERGED | +2 | 0 |