gecko-dev/netwerk
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
..
base Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-06-07 23:07:28 +01:00
build Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-06-07 23:07:28 +01:00
cache Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible r=Ehsan 2018-07-13 19:01:53 +09:00
cache2 Bug 1472945 - Remove some deadcode introduced by bug 1470355 r=valentin 2018-07-03 10:38:46 +02:00
cookie Bug 1474812 - No needs to store granted storage access in nsILoadInfo and in the inner window, r=ehsan 2018-07-13 12:02:19 +02:00
dns bug 1472662 - only send DNS_TRR_NS_VERIFIED telemetry once r=mcmanus 2018-07-11 09:43:38 +02:00
ipc Bug 1474812 - No needs to store granted storage access in nsILoadInfo and in the inner window, r=ehsan 2018-07-13 12:02:19 +02:00
locales Bug 1463398 - Removal of deprecated newChannel() API on nsIIOService r=ckerschb 2018-05-22 13:09:41 +01:00
mime Bug 1472145 - Part 1. Add support for identifying the WebP images MIME type. r=tnikkel 2018-06-29 20:30:05 -04:00
protocol Bug 1475420 - mark the TRR connection as DISABLE_TRR to avoid TXT deadlock r=valentin 2018-07-12 17:48:54 -04:00
sctp Bug 1458048 - Cherry pick usersctp rev 8789a6da02e2c7c03522bc6f275b302f6ef977fe; r=drno 2018-06-20 21:18:50 -04:00
socket Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
srtp Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
streamconv Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
system Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
test Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-06-07 23:07:28 +01:00
wifi Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
moz.build
necko-config.h.in Bug 1391467 - Remove --enable-necko-protocols. r=gps,valentin 2017-08-17 17:30:57 -07:00