Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1604)

Unified Diff: net/base/dnsrr_resolver.cc

Issue 6903061: Linux: Monitor resolv.conf for changes and use that to reload resolver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/dnsrr_resolver.cc
diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc
index 81f9111350cc39311504fd0272e21621c596ba58..7116a933d69e99365b3633857f1690903e9a8c77 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,19 @@ 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;
}
+#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();
- }
+#if !defined(OS_MACOSX) && !defined(OS_OPENBSD)
willchan no longer on Chromium 2011/07/14 15:42:32 It looks like this code will always be executed in
Craig 2011/07/18 16:18:13 Done.
+ DnsReloaderMaybeReload();
#endif
+ r = Do();
_res.options = saved_options;
}

Powered by Google App Engine
This is Rietveld 408576698