gecko-dev/toolkit
Polly Shaw 091db15fe1 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: HinC1UevOon

--HG--
extra : rebase_source : cf29f76826cc7728fd36505c8271bf50001c644c
2018-04-22 18:13:11 +01:00
..
components Merge inbound to mozilla-central. a=merge 2018-04-25 00:50:59 +03:00
content Merge inbound to mozilla-central. a=merge 2018-04-25 12:36:04 +03:00
crashreporter Bug 1456203 - Take patch from upstream lss to fix use of disallowed syscalls on Android r=ted 2018-04-24 14:22:25 -05:00
forgetaboutsite Bug 1455149 - toolkit/forgetaboutsite/ should use 'Toolkit::Data Sanitization' as bugzilla product and component. r=Gijs DONTBUILD 2018-04-19 15:33:04 +03:00
library Bug 1444151 - Part 3: Only create a single allocation for MozURL objects, which is managed by rust, r=valentin 2018-04-10 17:49:50 -04:00
locales Merge inbound to mozilla-central. a=merge 2018-04-25 00:50:59 +03:00
modules Backed out 2 changesets (bug 1447551) for browser-chrome failures on browser_UITour_detach_tab.js and devtools failures on browser_service_workers_not_compatible.js. CLOSED TREE 2018-04-24 22:27:47 +03:00
mozapps Merge inbound to mozilla-central. a=merge 2018-04-25 00:50:59 +03:00
pluginproblem
profile Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan 2018-03-16 14:29:15 +01:00
system Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-04-22 18:13:11 +01:00
themes Bug 1455392 - Remove sortable UI in about:addons recent updates;r=aswan 2018-04-20 09:35:36 -07:00
xre Bug 1372694: Part 2 - Remove support for registering non-bootstrapped extension chrome. r=aswan 2018-04-20 17:00:29 -07:00
.eslintrc.js bug 1442407 - increase eslint complexity level from 44 to 45 due to backout that reverted code that has a complexity level of 45. r=bustage CLOSED TREE 2018-03-01 15:35:43 -08:00
moz.build Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-04-22 18:13:11 +01:00
moz.configure Bug 1306529 - Add initial implementation of PureOmxPlatformLayer r=jya 2018-04-18 11:38:12 +09:00
nss.configure Bug 1446809 - Remove some b2g leftover in the build r=glandium 2018-03-20 10:46:23 +01:00
toolkit.mozbuild Bug 1454466 - Move raptor in-tree; r=ahal 2018-04-16 17:15:38 -04:00