Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: net/quic/quic_connection.cc

Issue 571993002: Do not allow a QUIC connection to timeout if no packets have been sent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Minor_change_to_retransmission_75290729
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | net/quic/quic_flags.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | net/quic/quic_flags.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698