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

Unified Diff: net/base/host_resolver_impl.cc

Issue 3067012: Merge 53487 - [Linux] Enable connecting to localhost when offline.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 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
« no previous file with comments | « net/base/host_resolver_impl.h ('k') | net/base/host_resolver_proc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_impl.cc
===================================================================
--- net/base/host_resolver_impl.cc (revision 53998)
+++ net/base/host_resolver_impl.cc (working copy)
@@ -715,7 +715,8 @@
resolver_proc_(resolver_proc),
default_address_family_(ADDRESS_FAMILY_UNSPECIFIED),
shutdown_(false),
- ipv6_probe_monitoring_(false) {
+ ipv6_probe_monitoring_(false),
+ additional_resolver_flags_(0) {
DCHECK_GT(max_jobs, 0u);
// It is cumbersome to expose all of the constraints in the constructor,
@@ -725,6 +726,10 @@
#if defined(OS_WIN)
EnsureWinsockInit();
#endif
+#if defined(OS_LINUX)
+ if (HaveOnlyLoopbackAddresses())
+ additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY;
+#endif
NetworkChangeNotifier::AddObserver(this);
}
@@ -1054,6 +1059,13 @@
ipv6_probe_job_ = new IPv6ProbeJob(this);
ipv6_probe_job_->Start();
}
+#if defined(OS_LINUX)
+ if (HaveOnlyLoopbackAddresses()) {
+ additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY;
+ } else {
+ additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY;
+ }
+#endif
}
void HostResolverImpl::DiscardIPv6ProbeJob() {
@@ -1124,7 +1136,7 @@
if (effective_address_family == ADDRESS_FAMILY_UNSPECIFIED)
effective_address_family = default_address_family_;
return Key(info.hostname(), effective_address_family,
- info.host_resolver_flags());
+ info.host_resolver_flags() | additional_resolver_flags_);
}
HostResolverImpl::Job* HostResolverImpl::CreateAndStartJob(Request* req) {
« no previous file with comments | « net/base/host_resolver_impl.h ('k') | net/base/host_resolver_proc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698