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

Unified Diff: net/quic/core/quic_connection.cc

Issue 2875333002: Landing Recent QUIC changes until Mon May 8 21:42:46 2017 +0000 (Closed)
Patch Set: Created 3 years, 7 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 | « net/quic/core/quic_connection.h ('k') | net/quic/core/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection.cc
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc
index 0d6e88a7472a06a30fa2d89cc88755c48130a83e..f803e2f31b59cea940b889787ecc0bcae488b445 100644
--- a/net/quic/core/quic_connection.cc
+++ b/net/quic/core/quic_connection.cc
@@ -207,6 +207,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
idle_timeout_connection_close_behavior_(
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET),
close_connection_after_five_rtos_(false),
+ close_connection_after_three_rtos_(false),
received_packet_manager_(&stats_),
ack_queued_(false),
num_retransmittable_packets_received_since_last_ack_sent_(0),
@@ -351,6 +352,11 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
if (config.HasClientSentConnectionOption(k5RTO, perspective_)) {
close_connection_after_five_rtos_ = true;
}
+ if (FLAGS_quic_reloadable_flag_quic_enable_3rtos &&
+ config.HasClientSentConnectionOption(k3RTO, perspective_)) {
+ QUIC_FLAG_COUNT(quic_reloadable_flag_quic_enable_3rtos);
+ close_connection_after_three_rtos_ = true;
+ }
if (packet_generator_.latched_flag_no_stop_waiting_frames() &&
version() > QUIC_VERSION_37 &&
config.HasClientSentConnectionOption(kNSTP, perspective_)) {
@@ -1123,6 +1129,8 @@ void QuicConnection::SendRstStream(QuicStreamId id,
ClearSerializedPacket(&(*packet_iterator));
packet_iterator = queued_packets_.erase(packet_iterator);
}
+ // TODO(ianswett): Consider checking for 3 RTOs when the last stream is
+ // cancelled as well.
}
void QuicConnection::SendWindowUpdate(QuicStreamId id,
@@ -1786,6 +1794,14 @@ void QuicConnection::SendAck() {
void QuicConnection::OnRetransmissionTimeout() {
DCHECK(sent_packet_manager_.HasUnackedPackets());
+ if (close_connection_after_three_rtos_ &&
+ sent_packet_manager_.GetConsecutiveRtoCount() >= 2 &&
+ !visitor_->HasOpenDynamicStreams()) {
+ // Close on the 3rd consecutive RTO, so after 2 previous RTOs have occurred.
+ CloseConnection(QUIC_TOO_MANY_RTOS, "3 consecutive retransmission timeouts",
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+ return;
+ }
if (close_connection_after_five_rtos_ &&
sent_packet_manager_.GetConsecutiveRtoCount() >= 4) {
// Close on the 5th consecutive RTO, so after 4 previous RTOs have occurred.
« no previous file with comments | « net/quic/core/quic_connection.h ('k') | net/quic/core/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698