From 1b8740fcc945425012ecc755987286dd22a098f6 Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Thu, 26 Aug 2010 05:12:47 +0000 Subject: Introduce an artificial 2 second delay after network IP address changes before re-running proxy auto-config. During this time network requests will be stalled. This is to work around a problem where DNS gives transient failures shortly after IP address changes. BUG=50779 TEST=On a linux laptop switch between wireless networks while using auto-detect. When you switch to a network that contains the host 'wpad' verify that when InitProxyResolver runs it does not get a DNS error resolving 'wpad'. (Use about:net-internals to view this information). Review URL: http://codereview.chromium.org/3151040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57471 0039d316-1c4b-4281-b951-d872f2087c98 --- net/proxy/proxy_service.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'net/proxy/proxy_service.h') diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index 8f30327..3b61fbb 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -193,6 +193,12 @@ class ProxyService : public base::RefCountedThreadSafe, static ProxyConfigService* CreateSystemProxyConfigService( MessageLoop* io_loop, MessageLoop* file_loop); +#if UNIT_TEST + void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { + stall_proxy_auto_config_delay_ = delay; + } +#endif + private: friend class base::RefCountedThreadSafe; FRIEND_TEST_ALL_PREFIXES(ProxyServiceTest, UpdateConfigAfterFailedAutodetect); @@ -302,6 +308,13 @@ class ProxyService : public base::RefCountedThreadSafe, // sent to. NetLog* net_log_; + // The earliest time at which we should run any proxy auto-config. (Used to + // stall re-configuration following an IP address change). + base::TimeTicks stall_proxy_autoconfig_until_; + + // The amount of time to stall requests following IP address changes. + base::TimeDelta stall_proxy_auto_config_delay_; + DISALLOW_COPY_AND_ASSIGN(ProxyService); }; -- cgit v1.1