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

Unified Diff: net/quic/quic_connection.cc

Issue 1918953003: Landing Recent QUIC changes until 4/22/2016 14:55 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted SpdyFramerTests missed while mergeing 120451808 Created 4 years, 8 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/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
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 1d7f3e5d15b5e59dcb0f3ac093c48b5bb80b823d..5c633d3c695a97e5113d769a511ba3e17c12ed34 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -69,6 +69,10 @@ const QuicPacketCount kDefaultRetransmittablePacketsBeforeAck = 2;
const QuicPacketCount kMinReceivedBeforeAckDecimation = 100;
// Wait for up to 10 retransmittable packets before sending an ack.
const QuicPacketCount kMaxRetransmittablePacketsBeforeAck = 10;
+// One quarter RTT delay when doing ack decimation.
+const float kAckDecimationDelay = 0.25;
+// One eighth RTT delay when doing ack decimation.
+const float kShortAckDecimationDelay = 0.125;
bool Near(QuicPacketNumber a, QuicPacketNumber b) {
QuicPacketNumber delta = (a > b) ? a - b : b - a;
@@ -246,6 +250,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
num_packets_received_since_last_ack_sent_(0),
stop_waiting_count_(0),
ack_mode_(TCP_ACKING),
+ ack_decimation_delay_(kAckDecimationDelay),
delay_setting_retransmission_alarm_(false),
pending_retransmission_alarm_(false),
defer_send_in_response_to_packets_(false),
@@ -372,10 +377,17 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
if (config.HasClientSentConnectionOption(kACKD, perspective_)) {
ack_mode_ = ACK_DECIMATION;
}
- if (FLAGS_quic_ack_decimation2 &&
- config.HasClientSentConnectionOption(kAKD2, perspective_)) {
+ if (config.HasClientSentConnectionOption(kAKD2, perspective_)) {
ack_mode_ = ACK_DECIMATION_WITH_REORDERING;
}
+ if (config.HasClientSentConnectionOption(kAKD3, perspective_)) {
+ ack_mode_ = ACK_DECIMATION;
+ ack_decimation_delay_ = kShortAckDecimationDelay;
+ }
+ if (config.HasClientSentConnectionOption(kAKD4, perspective_)) {
+ ack_mode_ = ACK_DECIMATION_WITH_REORDERING;
+ ack_decimation_delay_ = kShortAckDecimationDelay;
+ }
if (FLAGS_quic_enable_rto_timeout &&
config.HasClientSentConnectionOption(k5RTO, perspective_)) {
close_connection_after_five_rtos_ = true;
@@ -764,6 +776,14 @@ bool QuicConnection::OnStopWaitingFrame(const QuicStopWaitingFrame& frame) {
return connected_;
}
+bool QuicConnection::OnPaddingFrame(const QuicPaddingFrame& frame) {
+ DCHECK(connected_);
+ if (debug_visitor_ != nullptr) {
+ debug_visitor_->OnPaddingFrame(frame);
+ }
+ return true;
+}
+
bool QuicConnection::OnPingFrame(const QuicPingFrame& frame) {
DCHECK(connected_);
if (debug_visitor_ != nullptr) {
@@ -998,7 +1018,8 @@ void QuicConnection::MaybeQueueAck(bool was_missing) {
// Wait the minimum of a quarter min_rtt and the delayed ack time.
QuicTime::Delta ack_delay = QuicTime::Delta::Min(
sent_packet_manager_.DelayedAckTime(),
- sent_packet_manager_.GetRttStats()->min_rtt().Multiply(0.25));
+ sent_packet_manager_.GetRttStats()->min_rtt().Multiply(
+ ack_decimation_delay_));
ack_alarm_->Set(clock_->ApproximateNow().Add(ack_delay));
}
} else {
@@ -1790,8 +1811,12 @@ void QuicConnection::SendAck() {
}
void QuicConnection::OnRetransmissionTimeout() {
- if (!sent_packet_manager_.HasUnackedPackets()) {
- return;
+ if (FLAGS_quic_always_has_unacked_packets_on_timeout) {
+ DCHECK(sent_packet_manager_.HasUnackedPackets());
+ } else {
+ if (!sent_packet_manager_.HasUnackedPackets()) {
+ return;
+ }
}
if (close_connection_after_five_rtos_ &&
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698