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

Unified Diff: net/base/dnsrr_resolver.cc

Issue 6033006: Use FileWatcher to watch system resolver config, on systems that require... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years 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
===================================================================
--- net/base/dnsrr_resolver.cc (revision 70147)
+++ net/base/dnsrr_resolver.cc (working copy)
@@ -164,8 +164,14 @@
return;
}
+ bool need_init = (_res.options & RES_INIT) == 0;
+#if WATCH_RESOLV_CONF
+ need_init |= ResolvConfUpdated();
+#endif
+
bool r = true;
- if ((_res.options & RES_INIT) == 0) {
+ if (need_init) {
+ LOG(INFO) << "Initializing resolver";
if (res_ninit(&_res) != 0)
r = false;
}
@@ -174,7 +180,7 @@
unsigned long saved_options = _res.options;
r = Do();
-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
+#if WATCH_RESOLV_CONF
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

Powered by Google App Engine
This is Rietveld 408576698