diff options
Diffstat (limited to 'net/base/host_resolver_proc.cc')
-rw-r--r-- | net/base/host_resolver_proc.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc index 5ccf01a..84daae0 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_CANONNAME) + hints.ai_flags |= AI_CANONNAME; + // Restrict result set to only this socket type to avoid duplicates. hints.ai_socktype = SOCK_STREAM; |