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

Unified Diff: net/base/host_resolver_proc.cc

Issue 1566012: HostResolver supports optional CNAME lookups. (Closed)
Patch Set: Added CNAME details to about:net-internals Created 10 years, 8 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_proc.h ('k') | net/base/mock_host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_proc.cc
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 5ccf01afb4711a7e64919e23997a7fec04d2bb7c..feff5cfe837872bc6087aa6edc26a6a2c55335cc 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -67,14 +67,18 @@ HostResolverProc* HostResolverProc::GetDefault() {
return default_proc_;
}
-int HostResolverProc::ResolveUsingPrevious(const std::string& host,
- AddressFamily address_family,
- AddressList* addrlist) {
+int HostResolverProc::ResolveUsingPrevious(
+ const std::string& host,
+ AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
+ AddressList* addrlist) {
if (previous_proc_)
- return previous_proc_->Resolve(host, address_family, addrlist);
+ return previous_proc_->Resolve(host, address_family,
+ host_resolver_flags, addrlist);
// Final fallback is the system resolver.
- return SystemHostResolverProc(host, address_family, addrlist);
+ return SystemHostResolverProc(host, address_family,
+ host_resolver_flags, addrlist);
}
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
@@ -152,6 +156,7 @@ ThreadLocalStorage::Slot DnsReloadTimer::tls_index_(base::LINKER_INITIALIZED);
int SystemHostResolverProc(const std::string& host,
AddressFamily address_family,
+ HostResolverFlags host_resolver_flags,
AddressList* addrlist) {
// The result of |getaddrinfo| for empty hosts is inconsistent across systems.
// On Windows it gives the default interface's address, whereas on Linux it
@@ -205,6 +210,9 @@ int SystemHostResolverProc(const std::string& host,
hints.ai_flags = AI_ADDRCONFIG;
#endif
+ if (host_resolver_flags & HOST_RESOLVER_FLAGS_CANONNAME)
+ hints.ai_flags |= AI_CANONNAME;
+
// Restrict result set to only this socket type to avoid duplicates.
hints.ai_socktype = SOCK_STREAM;
« no previous file with comments | « net/base/host_resolver_proc.h ('k') | net/base/mock_host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698