[Development] QtNetwork: using system proxy by default

shane.kearns at accenture.com shane.kearns at accenture.com
Tue Oct 16 16:55:24 CEST 2012

> -----Original Message-----
> From: development-bounces+shane.kearns=accenture.com at qt-project.org
> [mailto:development-bounces+shane.kearns=accenture.com at qt-project.org]
> On Behalf Of Thiago Macieira
> Sent: 15 October 2012 18:41
> To: development at qt-project.org
> Subject: Re: [Development] QtNetwork: using system proxy by default
> On segunda-feira, 15 de outubro de 2012 16.33.39,
> shane.kearns at accenture.com
> wrote:
> > When using the windows API, we can enable either DNS, DHCP or both.
> > Using DNS only would be faster, but may not work for some users if
> > their office network used DHCP only deployment.
> >
> > Also, I checked today and it looks like Chromium have now implemented
> > DHCP autodetection by themselves as well. They are checking it on
> > startup & caching the results.
> IIRC, DHCP requires binding to port 67 in order to send the request,
> which requires root privileges on Unix systems. That means we can't do
> it.

Yes, that puts this outside our scope.
I'd rather not be implementing this only for windows.

> I'd create a (wall-clock) timer and enable the DHCP resolution on
> Windows only once every 10 minutes. I'd also use it as a fallback if
> and only if the DNS resolution failed.

That doesn't help with the 12 second freeze, since both methods fail if
you are on a network with no autoproxy.
We need to be calling WinHttpGetProxyForUrl or WinHttpDetectAutoProxyConfigUrl
in a thread, like we do for name resolutions.

There is also the non blocking WinHttpGetProxyForUrlEx, but that is new in windows 8.

> The only drawback is that we'll insist on a bad, cached result if the
> user moves from a network with DHCP and no DNS, to a network with no
> autoproxy. We could cache the host's IP addresses and discard the cache
> if they have changed too. Since we'll do that only once every 10
> minutes, the overhead will be minimal.

Caching the result and having some ways to invalidate the cache makes sense.
WinHttpDetectAutoProxyConfigUrl is the best thing to use, since it gives a pac file url,
which is the same thing as the static configuration would give us.

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.



More information about the Development mailing list