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

Unified Diff: net/dns/host_resolver_impl.cc

Issue 14760008: HostResolverImpl will return ERR_NAME_NOT_RESOLVED instead of Ok if address list is empty (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed Empty List check from OnProcTaskComplete. Created 7 years, 7 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 | « no previous file | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl.cc
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 0aed70d6b75deb230261d520cd742f2f9bcb3ea1..95e03ba7a912a857586e0ceaf1c6845a4679820d 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -682,7 +682,11 @@ class HostResolverImpl::ProcTask
int error,
const int os_error) {
DCHECK(origin_loop_->BelongsToCurrentThread());
- DCHECK(error || !results.empty());
+ // If results are empty, we should return an error.
+ bool empty_list_on_ok = (error == OK && results.empty());
+ UMA_HISTOGRAM_BOOLEAN("DNS.EmptyAddressListAndNoError", empty_list_on_ok);
+ if (empty_list_on_ok)
+ error = ERR_NAME_NOT_RESOLVED;
bool was_retry_attempt = attempt_number > 1;
« no previous file with comments | « no previous file | net/dns/host_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698