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

Unified Diff: net/base/dnsrr_resolver.cc

Issue 7833030: Revert 99666 (sync tests started failing on mac10.6: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- net/base/dnsrr_resolver.cc (revision 99676)
+++ net/base/dnsrr_resolver.cc (working copy)
@@ -20,7 +20,7 @@
#include "base/synchronization/lock.h"
#include "base/task.h"
#include "base/threading/worker_pool.h"
-#include "net/base/dns_reloader.h"
+#include "net/base/dns_reload_timer.h"
#include "net/base/dns_util.h"
#include "net/base/net_errors.h"
@@ -184,18 +184,26 @@
}
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