Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2
-
None
-
Linux 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux
Description
Setting a new proxy after the event loop is running is only effective after the first request is made:
- start_app
- set_proxy(proxy_1)
- request() -> OK, uses proxy_1
- set_proxy(proxy_2)
- request() -> FAIL, uses proxy_1
- request() -> OK, uses proxy_2
The same error happens with both
- QNetworkProxyFactory and
- QNetworkProxy::setApplicationProxy().
This error happens with:
- Debian Linux 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 x86_64 GNU/Linux
QMake version 3.1
Using Qt version 5.15.2 in /usr/lib/x86_64-linux-gnu
Works correctly with:
- Ubuntu Linux 5.13.0-39-generic #44~20.04.1-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
QMake version 3.1
Using Qt version 5.12.8 in /usr/lib/x86_64-linux-gnu
There is an attached test file. Usage instructions are in the test file.
From tests I have made with QNetworkProxyFactory, it seems that new proxy settings are evaluatedĀ after a request is made. But that is just an intuition.
I have tried the following (unsuccessfully) to work around the issue:
- set the same new proxy multiple time
- send a dummy request (non-existent URL) after setting a new proxy
- make sure to run the event loop / process pending events between setting a new proxy and sending a request