Chromium Code Reviews| Index: net/dns/dns_session.cc |
| diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc |
| index 15cbaa209a4eb81752df970af11dd31c60cda27c..2427027738918ed0f4010b1cc2e8ce4275739a32 100644 |
| --- a/net/dns/dns_session.cc |
| +++ b/net/dns/dns_session.cc |
| @@ -24,21 +24,21 @@ DnsSession::DnsSession(const DnsConfig& config, |
| server_index_(0) { |
| } |
| -int DnsSession::NextId() const { |
| +int DnsSession::NextQueryId() const { |
| return rand_callback_.Run(); |
| } |
| -const IPEndPoint& DnsSession::NextServer() { |
| - // TODO(szym): Rotate servers on failures. |
| - const IPEndPoint& ipe = config_.nameservers[server_index_]; |
| +int DnsSession::NextFirstServerIndex() { |
| + int index = server_index_; |
| if (config_.rotate) |
| server_index_ = (server_index_ + 1) % config_.nameservers.size(); |
| - return ipe; |
| + return index; |
| } |
| base::TimeDelta DnsSession::NextTimeout(int attempt) { |
| - // TODO(szym): Adapt timeout to observed RTT. |
| - return config_.timeout * (attempt + 1); |
| + // The timeout doubles every full round (each nameserver once). |
| + // TODO(szym): Adapt timeout to observed RTT. BUG=110197 |
|
cbentzel
2012/01/21 03:41:16
Nit: direct link to crbug.com is more common than
|
| + return config_.timeout * (1 << (attempt / config_.nameservers.size())); |
| } |
| DnsSession::~DnsSession() {} |