[Development] QtNetwork: using system proxy by default

Thiago Macieira thiago.macieira at intel.com
Mon Oct 15 19:40:57 CEST 2012


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.

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. 

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.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121015/a7b012fa/attachment.sig>


More information about the Development mailing list