Priority: Not Evaluated
Affects Version/s: 4.7.2
Fix Version/s: None
Component/s: Network: Proxies
When called "QNetworkProxyFactory::SystemProxyForQuery()" method in main thread, it successfully retrieved the proxy information. But when called from secondary thread (without calling it in main thread), this is not retrieving proxy information. Please check the attached sample app to reproduce this issue (SystemProxyforQueryVerifyApp.zip file).
I debugged SystemProxyForQuery() method in both success (called from main thread) and failure (called from secondary thread) scenarios. Please see my observations below.
SystemProxyForQuery() called from Main Thread [Success Scenario]:
1. "findCurrentConfiguration()" method internally calling "configurationManager.allConfigurations(QNetworkConfiguration::Active)" method to retrieve activeConfigurations. This call succeeded with "if (activeConfigurations.count() > 0)" call returning true. This retrieved activeConfiguration was returned from this function, which is a valid configuration, hence retrieved proxy information successfully.
SystemProxyForQuery() called from Secondary Thread [Failure Scenario]:
1. "findCurrentConfiguration()" method internally calling "configurationManager.allConfigurations(QNetworkConfiguration::Active)" method to retrieve activeConfigurations. But it failed to retrieve any.
2. So, "if (activeConfigurations.count() > 0)" call returned false, then it tried to return "configurationManager.defaultConfiguration()". But this also failed to retrieve any valid configuration.
3. With this, "findCurrentConfiguration()" method is returning "invalidConfiguration", which led to non-retrieval of proxy information.
Looking forward for some solution for this issue. Please let me know if you need more information on this issue.
Thanks & Regards,