| Index: net/dns/dns_session.cc
|
| diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc
|
| index 15cbaa209a4eb81752df970af11dd31c60cda27c..fb6c4b4c5ba269157bf7ca29cc7d5c06052ccda1 100644
|
| --- a/net/dns/dns_session.cc
|
| +++ b/net/dns/dns_session.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -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. http://crbug.com/110197
|
| + return config_.timeout * (1 << (attempt / config_.nameservers.size()));
|
| }
|
|
|
| DnsSession::~DnsSession() {}
|
|
|