| Index: net/quic/quic_connection.cc
|
| diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
|
| index e25c70097e454beec6baba9bb1ec72afc86afecc..46e6ea137193110c255c46c9eaac4b41e397dcf1 100644
|
| --- a/net/quic/quic_connection.cc
|
| +++ b/net/quic/quic_connection.cc
|
| @@ -219,12 +219,8 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
|
| idle_network_timeout_(
|
| QuicTime::Delta::FromSeconds(kDefaultInitialTimeoutSecs)),
|
| overall_connection_timeout_(QuicTime::Delta::Infinite()),
|
| - time_of_last_received_packet_(
|
| - FLAGS_quic_timeouts_require_activity
|
| - ? QuicTime::Zero() : clock_->ApproximateNow()),
|
| - time_of_last_sent_new_packet_(
|
| - FLAGS_quic_timeouts_require_activity
|
| - ? QuicTime::Zero() : clock_->ApproximateNow()),
|
| + time_of_last_received_packet_(clock_->ApproximateNow()),
|
| + time_of_last_sent_new_packet_(clock_->ApproximateNow()),
|
| sequence_number_of_last_sent_packet_(0),
|
| sent_packet_manager_(
|
| is_server, clock_, &stats_,
|
| @@ -1880,7 +1876,11 @@ void QuicConnection::SetIdleNetworkTimeout(QuicTime::Delta timeout) {
|
|
|
| if (timeout < idle_network_timeout_) {
|
| idle_network_timeout_ = timeout;
|
| - CheckForTimeout();
|
| + if (FLAGS_quic_timeouts_only_from_alarms) {
|
| + SetTimeoutAlarm();
|
| + } else {
|
| + CheckForTimeout();
|
| + }
|
| } else {
|
| idle_network_timeout_ = timeout;
|
| }
|
| @@ -1889,7 +1889,11 @@ void QuicConnection::SetIdleNetworkTimeout(QuicTime::Delta timeout) {
|
| void QuicConnection::SetOverallConnectionTimeout(QuicTime::Delta timeout) {
|
| if (timeout < overall_connection_timeout_) {
|
| overall_connection_timeout_ = timeout;
|
| - CheckForTimeout();
|
| + if (FLAGS_quic_timeouts_only_from_alarms) {
|
| + SetTimeoutAlarm();
|
| + } else {
|
| + CheckForTimeout();
|
| + }
|
| } else {
|
| overall_connection_timeout_ = timeout;
|
| }
|
| @@ -1900,14 +1904,6 @@ void QuicConnection::CheckForTimeout() {
|
| QuicTime time_of_last_packet = max(time_of_last_received_packet_,
|
| time_of_last_sent_new_packet_);
|
|
|
| - // If no packets have been sent or received, then don't timeout.
|
| - if (FLAGS_quic_timeouts_require_activity &&
|
| - !time_of_last_packet.IsInitialized()) {
|
| - timeout_alarm_->Cancel();
|
| - timeout_alarm_->Set(now.Add(idle_network_timeout_));
|
| - return;
|
| - }
|
| -
|
| // |delta| can be < 0 as |now| is approximate time but |time_of_last_packet|
|
| // is accurate time. However, this should not change the behavior of
|
| // timeout handling.
|
|
|