Chromium Code Reviews| Index: net/dns/host_resolver_impl.cc |
| diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc |
| index 98e410551e9c3599de5d64b2a7a8ca6fc01267d1..2081864319531d96bbd0a569eede6f9ca34a29e1 100644 |
| --- a/net/dns/host_resolver_impl.cc |
| +++ b/net/dns/host_resolver_impl.cc |
| @@ -49,6 +49,7 @@ |
| #include "net/dns/host_resolver_proc.h" |
| #include "net/socket/client_socket_factory.h" |
| #include "net/udp/datagram_client_socket.h" |
| +#include "url/url_canon_ip.h" |
| #if defined(OS_WIN) |
| #include "net/base/winsock_init.h" |
| @@ -2154,7 +2155,14 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( |
| AddressFamily effective_address_family = info.address_family(); |
| if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) { |
| - if (probe_ipv6_support_ && !use_local_ipv6_) { |
| + IPAddressNumber ip_number; |
| + url::Component host_comp(0, info.hostname().size()); |
| + int num_components; |
| + if (probe_ipv6_support_ && !use_local_ipv6_ && |
| + // Don't bother IPv6 probing when resolving IPv4 literals. |
| + url::IPv4AddressToNumber(info.hostname().data(), host_comp, |
| + &ip_number[0], |
| + &num_components) != url::CanonHostInfo::IPV4) { |
|
mmenke
2015/02/13 15:03:27
Doing this twice seems weird...Maybe we should jus
pauljensen
2015/02/13 15:33:08
I changed the code to parse it just once. WDYT?
|
| // Google DNS address. |
| const uint8 kIPv6Address[] = |
| { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, |