Index: net/dns/dns_transaction.cc |
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc |
index a6a57410de41b6dcd1dc5e21cd4f09977cbd30f1..36ca56881d839905d22c755aac2709eae887b2e1 100644 |
--- a/net/dns/dns_transaction.cc |
+++ b/net/dns/dns_transaction.cc |
@@ -802,14 +802,16 @@ class DnsTransactionImpl : public DnsTransaction, |
if (first_completed == attempts_.size()) |
return; |
- std::vector<int> num_rounds(session_->config().nameservers.size()); |
+ size_t num_servers = session_->config().nameservers.size(); |
for (size_t i = 0; i < first_completed; ++i) { |
- unsigned server_index = attempts_[i]->GetServerIndex(); |
- int server_round = num_rounds[server_index]++; |
// Don't record lost packet unless attempt is in pending state. |
if (!attempts_[i]->is_pending()) |
continue; |
- session_->RecordLostPacket(server_index, server_round); |
+ unsigned server_index = attempts_[i]->GetServerIndex(); |
+ // currently servers are rotated in round robin, so server round can be |
+ // calculated from attempt index |
szym
2013/05/29 17:09:42
nit: Format like a sentence.
mef
2013/05/29 17:24:04
Done.
|
+ size_t server_round = i / num_servers; |
+ session_->RecordLostPacket(server_index, static_cast<int>(server_round)); |
} |
} |