gecko-dev/toolkit
Polly Shaw 226a5beff6 Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin
This patch addresses an issue with Firefox's proxy detection on networks which
do not have their a proxy auto-configuration (PAC) file hosted at
http://wpad/wpad.dat, and instead make use of DHCP option 252 for broadcasting
the address of the PAC file. See https://findproxyforurl.com/wpad-introduction/
for an introduction to the protocol.

Prior to this patch, proxy auto-detect missed out the DHCP query stage, and just
 looked for a PAC file at http://wpad/wpad.dat


This patch only addresses the issue for Firefox on Windows, although it defines a
DHCP client interface which could be implemented on other platforms.

The high-level components of this patch are:
 * nsIDHCPClient.idl - this is an interface which has been defined for querying the
   DHCP server.
 * nsPACMan.cpp - where previously when the PAC URL was simply set to a constant of
   http://wpad/wpad.dat, it now dispatches an asynchronous command to the proxy
   thread. The class ExecutePACThreadAction has been augmented to include an
   instruction to 'ConfigureWPAD' (Configure Web-proxy auto-detect), and a new class,
   'ConfigureWPADComplete' has been created to relay the result (the URL of the PAC
   file) back to the nsPACMan object.
 * nsProtocolProxyService.cpp
   Minor changes to reflect the fact that the PAC URL not being set does not always
   mean there is no PAC to be used; instead it could be in the process of being
   detected.
 * TestPACMan.cpp
   This is a new file, and tests only the DHCP auto-detect functionality.
   Some tests use multiple threads, as they test the non-blocking proxy detection.
 * DHCPUtils.cpp
   A class containing the main logic for querying DHCP.
 * WindowsNetworkFunctionsWrapper.cpp
   A very thin wrapper around the Windows API calls needed by DHCPUtils.
   This class was introduced so it could be mocked out in tests.
 * nsWindowsDHCPClient.cpp
 * An implementation of the interface defined in nsIDHCPClient.idl. Fairly thin:
   most logic is implemented in DHCPUtils.
 * TestDHCPUtils.cpp
   Tests for DHCPUtils and nsWindowsDHCPClient

MozReview-Commit-ID: 4xFQz3tOLEx

--HG--
extra : rebase_source : dfd5c588406a8b0d92f91cc8a0038ca722b7140a
2018-06-07 23:07:28 +01:00
..
components Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-07-14 12:45:25 +03:00
content Bug 1471485 - Hide autoplay permission doorhanger if user plays video. r=johannh 2018-07-03 11:17:16 +12:00
crashreporter Bug 1460022: Part 10 - Update crash reporter to work with revised DLL interceptor interface; r=dmajor 2018-06-27 11:51:40 -06:00
forgetaboutsite Bug 1470109 - Move ServiceWorkerCleanUp.jsm into toolkit/components/cleardata, r=johannh 2018-06-21 16:50:10 +02:00
library Merge inbound to mozilla-central. a=merge 2018-07-10 12:45:13 +03:00
locales Merge inbound to mozilla-central. a=merge 2018-07-04 00:56:24 +03:00
modules Bug 1475012 - fix ordering of getTopFrecentSites in ActivityStreamProvider r=ursula 2018-07-11 12:26:39 -07:00
mozapps Backed out 7 changesets (bug 1420514) for breaking bc on different files on a CLOSED TREE 2018-07-12 21:22:32 +03:00
pluginproblem Bug 1456625 - Remove replacement XBL binding (Backout cb51f3bada90) r=Felipe 2018-05-24 18:23:48 +08:00
profile Bug 1472750 - Convert simple "listbox" instances to "richlistbox". r=bgrins 2018-07-09 10:38:42 +01:00
system Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-06-07 23:07:28 +01:00
themes Merge inbound to mozilla-central. a=merge 2018-07-14 00:52:51 +03:00
xre Backed out 12 changesets (bug 1471025) for build bustages on dom/ipc/ContentProcess.cpp. CLOSED TREE 2018-07-13 22:11:24 +03:00
.eslintrc.js
moz.build Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-06-07 23:07:28 +01:00
moz.configure Bug 1473436 - Disable elfhack on local builds. r=chmanchester 2018-07-05 09:23:56 +09:00
nss.configure
toolkit.mozbuild Bug 833098: Part 1 - Remove dead code in xpfe directory viewer. r=Mossop 2018-04-28 21:28:03 -07:00