From 46018c9d614cd47961cad5a39416687ebdd8d1cd Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 6 Sep 2011 03:42:34 +0000 Subject: Revert 99677 (didn't help) - Revert 99666 (sync tests started failing on mac10.6: http://build.chromium.org/p/chromium/builders/Mac10.6%20Sync/builds/9198 - Linux: Monitor resolv.conf for changes and use that to reload resolver. BUG=67734 TEST=manual testing by poking at resolv.conf Review URL: http://codereview.chromium.org/6903061 TBR=craig.schlenter@chromium.org Review URL: http://codereview.chromium.org/7833030 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/7737034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99693 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/dnsrr_resolver.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'net/base/dnsrr_resolver.cc') diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc index 2cfb0cf..e0d43d9 100644 --- a/net/base/dnsrr_resolver.cc +++ b/net/base/dnsrr_resolver.cc @@ -20,7 +20,7 @@ #include "base/synchronization/lock.h" #include "base/task.h" #include "base/threading/worker_pool.h" -#include "net/base/dns_reload_timer.h" +#include "net/base/dns_reloader.h" #include "net/base/dns_util.h" #include "net/base/net_errors.h" @@ -184,26 +184,18 @@ class RRResolverWorker { } bool r = true; +#if defined(OS_MACOSX) || defined(OS_OPENBSD) if ((_res.options & RES_INIT) == 0) { if (res_ninit(&_res) != 0) r = false; } +#else + DnsReloaderMaybeReload(); +#endif if (r) { unsigned long saved_options = _res.options; r = Do(); - -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) - if (!r && DnsReloadTimerHasExpired()) { - // When there's no network connection, _res may not be initialized by - // getaddrinfo. Therefore, we call res_nclose only when there are ns - // entries. - if (_res.nscount > 0) - res_nclose(&_res); - if (res_ninit(&_res) == 0) - r = Do(); - } -#endif _res.options = saved_options; } -- cgit v1.1