gecko-dev/netwerk/test/gtest
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
..
parse-ftp Bug 1402151, part 6 - Manual fixups for times in E-EPLF.out. r=michal 2017-09-25 12:53:01 -07:00
TestBufferedInputStream.cpp Bug 1413920 - nsMultiplexInputStream should call OnInputStreamReady on close, r=smaug 2017-11-06 14:20:15 +01:00
TestHeaders.cpp Bug 1334776 - Store header names into nsHttpHeaderArray. r=mcmanus 2017-04-27 16:48:36 +02:00
TestHttpAuthUtils.cpp Bug 1431204 - Change calls to nsIURI.spec setter to use nsIURIMutator instead r=mayhemer 2018-01-19 15:19:42 +01:00
TestMozURL.cpp Bug 1444151 - Part 4: Remove the now-unnecessary xpcom-style segment getters, r=valentin 2018-04-10 17:49:50 -04:00
TestPACMan.cpp Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-04-22 18:13:11 +01:00
TestPartiallySeekableInputStream.cpp Bug 1405976 - PartiallySeekableInputStream must take the ownership of the underlying stream, r=qdot 2017-10-13 10:07:32 +02:00
TestProtocolProxyService.cpp Bug 1431204 - Change calls to nsIURI.spec setter to use nsIURIMutator instead r=mayhemer 2018-01-19 15:19:42 +01:00
TestReadStreamToString.cpp Bug 1437152 - NS_ReadInputStreamToString doesn't reallocate the string if the size is passed, r=froydnj 2018-02-12 17:40:17 +01:00
TestServerTimingHeader.cpp Bug 1413999 - Part4: Test case r=dragana 2018-01-03 18:59:00 +02:00
TestStandardURL.cpp Bug 1442242 - Make the constuctors of URI implementations private r=mayhemer 2018-03-20 23:23:31 +01:00
TestURIMutator.cpp Bug 1425318 - The second call to NS_MutateURI.Finalize should fail r=mayhemer 2017-12-19 02:06:45 +01:00
moz.build Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-04-22 18:13:11 +01:00