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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 1177933002: Resolve RFC 6761 localhost names to loopback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rsleevi nit Created 5 years, 6 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/dns/host_resolver_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/base_test_server.cc
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index 5d97f8dd6bca5ce51a7f0f51bb723cddac66486c..dddb02dc2abdd4e361722b23fb098b14521a0173 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -236,6 +236,13 @@ bool BaseTestServer::GetAddressList(AddressList* address_list) const {
scoped_ptr<HostResolver> resolver(HostResolver::CreateDefaultResolver(NULL));
HostResolver::RequestInfo info(host_port_pair_);
+ // Limit the lookup to IPv4. When started with the default
+ // address of kLocalhost, testserver.py only supports IPv4.
+ // If a custom hostname is used, it's possible that the test
+ // server will listen on both IPv4 and IPv6, so this will
+ // still work. The testserver does not support explicit
+ // IPv6 literal hostnames.
+ info.set_address_family(ADDRESS_FAMILY_IPV4);
TestCompletionCallback callback;
int rv = resolver->Resolve(info,
DEFAULT_PRIORITY,
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698