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

Unified Diff: net/quic/quic_connection.cc

Issue 1806083002: Add a new QUIC connection option, 5RTO, which closes the QUIC connection after 5 consecutive RTOs. … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116677107
Patch Set: Created 4 years, 9 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
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 3e807a35281453173730faff0259dea8612d4b5d..afd5e50e4e401d832fcc311d610e09f3305b5e8b 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -235,6 +235,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
pending_version_negotiation_packet_(false),
save_crypto_packets_as_termination_packets_(false),
silent_close_enabled_(false),
+ close_connection_after_five_rtos_(false),
received_packet_manager_(&stats_),
ack_queued_(false),
num_retransmittable_packets_received_since_last_ack_sent_(0),
@@ -370,6 +371,10 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
config.HasClientSentConnectionOption(kAKD2, perspective_)) {
ack_mode_ = ACK_DECIMATION_WITH_REORDERING;
}
+ if (FLAGS_quic_enable_rto_timeout &&
+ config.HasClientSentConnectionOption(k5RTO, perspective_)) {
+ close_connection_after_five_rtos_ = true;
+ }
}
void QuicConnection::OnSendConnectionState(
@@ -1782,6 +1787,14 @@ void QuicConnection::OnRetransmissionTimeout() {
return;
}
+ if (close_connection_after_five_rtos_ &&
+ sent_packet_manager_.consecutive_rto_count() >= 4) {
+ // Close on the 5th consecutive RTO, so after 4 previous RTOs have occurred.
+ SendConnectionCloseWithDetails(QUIC_TOO_MANY_RTOS,
+ "5 consecutive retransmission timeouts");
+ return;
+ }
+
sent_packet_manager_.OnRetransmissionTimeout();
WriteIfNotBlocked();

Powered by Google App Engine
This is Rietveld 408576698