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

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: Created 7 years, 8 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') | net/dns/host_resolver_impl_unittest.cc » ('J')
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..55560fdc38e070373dcb3fdd1d7cc498d2b6ab8d 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -682,7 +682,9 @@ class HostResolverImpl::ProcTask
int error,
const int os_error) {
DCHECK(origin_loop_->BelongsToCurrentThread());
- DCHECK(error || !results.empty());
szym 2013/05/04 07:46:32 Ok, hold on a second. If this DCHECK is here, then
+ // empty results are not OK
szym 2013/05/04 07:46:32 nit: Comments should be full sentences, with capit
mef 2013/05/06 16:49:11 Done.
+ if (error == OK && results.empty())
+ error = ERR_NAME_NOT_RESOLVED;
szym 2013/05/04 07:46:32 If you change |error| here then your |empty_list_o
mef 2013/05/06 16:49:11 Done.
bool was_retry_attempt = attempt_number > 1;
@@ -1437,6 +1439,12 @@ class HostResolverImpl::Job : public PrioritizedDispatcher::Job {
}
}
+ bool empty_list_on_ok = (net_error == OK && addr_list.empty());
+ UMA_HISTOGRAM_BOOLEAN("Net.DNS_EmptyListOnOk", empty_list_on_ok);
szym 2013/05/04 07:46:32 I'd suggest putting the histogram in DNS. Also, wh
mef 2013/05/06 16:49:11 Done.
mef 2013/05/06 16:49:11 Done.
+ if (empty_list_on_ok) {
szym 2013/05/04 07:46:32 nit: no need for braces
mef 2013/05/06 16:49:11 Done.
+ 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') | net/dns/host_resolver_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698