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

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: change NET_API to NET_EXPORT Created 9 years, 3 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
« no previous file with comments | « net/base/dns_reloader.cc ('k') | net/base/host_resolver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/dnsrr_resolver.cc
diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc
index 2cfb0cfcca175cf5fbdca7f000be5a08ae7fbb9e..e0d43d90215a9c798cf07dc2a6c9b45b37251a98 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;
}
« no previous file with comments | « net/base/dns_reloader.cc ('k') | net/base/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698