| Index: net/dns/dns_session.cc
|
| diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc
|
| index 15cbaa209a4eb81752df970af11dd31c60cda27c..6b2d02b27cdacb95c502cb420797ab817373468d 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) {
|
| + // The timeout doubles every full round (each nameserver once).
|
| // TODO(szym): Adapt timeout to observed RTT.
|
| - return config_.timeout * (attempt + 1);
|
| + return config_.timeout * (1 << (attempt / config_.nameservers.size()));
|
| }
|
|
|
| DnsSession::~DnsSession() {}
|
|
|