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

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: Address code review comments. 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..e7f7d4b9e867e063fda96a4ba03e24f29c9d5a6c 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.EmptyAddressListAndNoError1", empty_list_on_ok);
+ if (empty_list_on_ok)
+ error = ERR_NAME_NOT_RESOLVED;
bool was_retry_attempt = attempt_number > 1;
@@ -1437,6 +1441,11 @@ class HostResolverImpl::Job : public PrioritizedDispatcher::Job {
}
}
+ bool empty_list_on_ok = (net_error == OK && addr_list.empty());
szym 2013/05/06 20:07:02 As I pointed out before, I don't think this can ev
mef 2013/05/07 14:53:40 Done. I left it here because my previous experimen
+ UMA_HISTOGRAM_BOOLEAN("DNS.EmptyAddressListAndNoError2", empty_list_on_ok);
+ if (empty_list_on_ok)
+ net_error = ERR_NAME_NOT_RESOLVED;
+
if (dns_task_error_ != OK) {
base::TimeDelta duration = base::TimeTicks::Now() - start_time;
if (net_error == OK) {
« 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