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

Unified Diff: net/base/host_resolver_proc.cc

Issue 164546: Undisable HostResolverImplTest.EmptyHost, by making empty host fail to resolv... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: reword Created 11 years, 4 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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_proc.cc
===================================================================
--- net/base/host_resolver_proc.cc (revision 23412)
+++ net/base/host_resolver_proc.cc (working copy)
@@ -125,6 +125,12 @@
#endif // defined(OS_LINUX)
int SystemHostResolverProc(const std::string& host, 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
+ // gives an error. We will make it fail on all platforms for consistency.
+ if (host.empty())
+ return ERR_NAME_NOT_RESOLVED;
+
struct addrinfo* ai = NULL;
struct addrinfo hints = {0};
hints.ai_family = AF_UNSPEC;
« no previous file with comments | « net/base/host_resolver_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698