Chromium Code Reviews| Index: net/dns/dns_transaction.cc |
| diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc |
| index 6cd02a33bd5b707945971bf300d3540d7a031c0d..3f127823058d23afec6a2c7423b1acb9cb9c3a20 100644 |
| --- a/net/dns/dns_transaction.cc |
| +++ b/net/dns/dns_transaction.cc |
| @@ -78,7 +78,7 @@ class ResponseParameters : public NetLog::EventParameters { |
| DictionaryValue* dict = new DictionaryValue(); |
| dict->SetInteger("rcode", rcode_); |
| dict->SetInteger("answer_count", answer_count_); |
| - dict->Set("socket_source", source_.ToValue()); |
| + dict->Set("source_dependency", source_.ToValue()); |
| return dict; |
| } |
| @@ -211,8 +211,14 @@ class DnsUDPAttempt { |
| return rv; |
| DCHECK(rv); |
| - if (!response_->InitParse(rv, *query_)) |
| + if (!response_->InitParse(rv, *query_)) { |
| + // TODO(szym): Consider making this reaction less aggressive. |
| + // Other implementations simply ignore mismatched responses. Since each |
| + // DnsUDPAttempt binds to a different port, we might find that responses |
| + // to previously timed out queries lead to failures in the future. |
| + // http://crbug.com/107413 |
| return ERR_DNS_MALFORMED_RESPONSE; |
| + } |
| if (response_->flags() & dns_protocol::kFlagTC) |
| return ERR_DNS_SERVER_REQUIRES_TCP; |
| if (response_->rcode() != dns_protocol::kRcodeNOERROR && |
| @@ -303,6 +309,10 @@ class DnsTransactionImpl : public DnsTransaction, public base::NonThreadSafe { |
| return rv; |
| } |
| + virtual const BoundNetLog& net_log() const { |
|
mmenke
2012/02/15 19:54:16
nit: OVERRIDE
|
| + return net_log_; |
| + } |
| + |
| private: |
| // Prepares |qnames_| according to the DnsConfig. |
| int PrepareSearch() { |
| @@ -387,7 +397,8 @@ class DnsTransactionImpl : public DnsTransaction, public base::NonThreadSafe { |
| } |
| net_log_.AddEvent(NetLog::TYPE_DNS_TRANSACTION_ATTEMPT, make_scoped_refptr( |
| - new NetLogSourceParameter("socket_source", socket->NetLog().source()))); |
| + new NetLogSourceParameter("source_dependency", |
| + socket->NetLog().source()))); |
| const DnsConfig& config = session_->config(); |
| @@ -451,7 +462,7 @@ class DnsTransactionImpl : public DnsTransaction, public base::NonThreadSafe { |
| DoCallback(rv, attempt); |
| return; |
| default: |
| - // TODO(szym): Some nameservers could fail so try the next one. |
| + // Some nameservers could fail so try the next one. |
| const DnsConfig& config = session_->config(); |
| if (attempts_.size() < config.attempts * config.nameservers.size()) { |
| rv = MakeAttempt(); |