| Index: net/tools/quic/quic_time_wait_list_manager.cc
|
| diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc
|
| index 6686238a03cf7859e8372befdaca945dc9536e8e..ffe3dd4df00925c5c789d0e85f72850e73828440 100644
|
| --- a/net/tools/quic/quic_time_wait_list_manager.cc
|
| +++ b/net/tools/quic/quic_time_wait_list_manager.cc
|
| @@ -267,9 +267,8 @@ void QuicTimeWaitListManager::SetConnectionIdCleanUpAlarm() {
|
| QuicTime oldest_connection_id =
|
| connection_id_map_.begin()->second.time_added;
|
| QuicTime now = clock_->ApproximateNow();
|
| - if (now.Subtract(oldest_connection_id) < time_wait_period_) {
|
| - next_alarm_interval =
|
| - oldest_connection_id.Add(time_wait_period_).Subtract(now);
|
| + if (now - oldest_connection_id < time_wait_period_) {
|
| + next_alarm_interval = oldest_connection_id + time_wait_period_ - now;
|
| } else {
|
| LOG(ERROR) << "ConnectionId lingered for longer than time_wait_period_";
|
| }
|
| @@ -278,8 +277,8 @@ void QuicTimeWaitListManager::SetConnectionIdCleanUpAlarm() {
|
| next_alarm_interval = time_wait_period_;
|
| }
|
|
|
| - connection_id_clean_up_alarm_->Set(
|
| - clock_->ApproximateNow().Add(next_alarm_interval));
|
| + connection_id_clean_up_alarm_->Set(clock_->ApproximateNow() +
|
| + next_alarm_interval);
|
| }
|
|
|
| bool QuicTimeWaitListManager::MaybeExpireOldestConnection(
|
| @@ -300,7 +299,7 @@ bool QuicTimeWaitListManager::MaybeExpireOldestConnection(
|
|
|
| void QuicTimeWaitListManager::CleanUpOldConnectionIds() {
|
| QuicTime now = clock_->ApproximateNow();
|
| - QuicTime expiration = now.Subtract(time_wait_period_);
|
| + QuicTime expiration = now - time_wait_period_;
|
|
|
| while (MaybeExpireOldestConnection(expiration)) {
|
| }
|
|
|