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

Unified Diff: net/quic/congestion_control/tcp_cubic_sender_packets.cc

Issue 1811043002: Landing Recent QUIC changes until 2016-03-15 16:26 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an export clause. 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/congestion_control/tcp_cubic_sender_packets.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender_packets.cc b/net/quic/congestion_control/tcp_cubic_sender_packets.cc
index ee2837aca6cee84656373e04d558eacce8857138..e1c225febb4ad1338484022f645042b891b26e48 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_packets.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_packets.cc
@@ -80,16 +80,29 @@ void TcpCubicSenderPackets::ExitSlowstart() {
}
void TcpCubicSenderPackets::OnPacketLost(QuicPacketNumber packet_number,
+ QuicByteCount lost_bytes,
QuicByteCount bytes_in_flight) {
// TCP NewReno (RFC6582) says that once a loss occurs, any losses in packets
// already sent should be treated as a single loss event, since it's expected.
if (packet_number <= largest_sent_at_last_cutback_) {
if (last_cutback_exited_slowstart_) {
++stats_->slowstart_packets_lost;
+ stats_->slowstart_bytes_lost += lost_bytes;
if (slow_start_large_reduction_) {
- // Reduce congestion window by 1 for every loss.
- congestion_window_ =
- max(congestion_window_ - 1, min_congestion_window_);
+ if (FLAGS_quic_sslr_byte_conservation) {
+ if (stats_->slowstart_packets_lost == 1 ||
+ (stats_->slowstart_bytes_lost / kDefaultTCPMSS) >
+ (stats_->slowstart_bytes_lost - lost_bytes) /
+ kDefaultTCPMSS) {
+ // Reduce congestion window by 1 for every mss of bytes lost.
+ congestion_window_ =
+ max(congestion_window_ - 1, min_congestion_window_);
+ }
+ } else {
+ // Reduce congestion window by 1 for every loss.
+ congestion_window_ =
+ max(congestion_window_ - 1, min_congestion_window_);
+ }
slowstart_threshold_ = congestion_window_;
}
}
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_packets.h ('k') | net/quic/congestion_control/tcp_cubic_sender_packets_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698