| Index: net/quic/quic_connection.cc
|
| diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
|
| index c03f115fcefcf394398f6bbb05f3f719aa3c6b0d..a45917e60fcab1353527cd80ab4a94a0bc7de438 100644
|
| --- a/net/quic/quic_connection.cc
|
| +++ b/net/quic/quic_connection.cc
|
| @@ -207,8 +207,12 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
|
| idle_network_timeout_(
|
| QuicTime::Delta::FromSeconds(kDefaultInitialTimeoutSecs)),
|
| overall_connection_timeout_(QuicTime::Delta::Infinite()),
|
| - time_of_last_received_packet_(clock_->ApproximateNow()),
|
| - time_of_last_sent_new_packet_(clock_->ApproximateNow()),
|
| + 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()),
|
| sequence_number_of_last_sent_packet_(0),
|
| sent_packet_manager_(
|
| is_server, clock_, &stats_,
|
| @@ -1889,6 +1893,14 @@ bool 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 recieved, 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 false;
|
| + }
|
| +
|
| // |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.
|
|
|