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

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

Issue 355573007: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added NET_EXPORT_PRIVATE for ContainsQuicTag Created 6 years, 6 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.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index 19f07d40e55c9e7cf97c63b5731307c25f123ab0..a9ca66c0cfb124e79916b50f93dd1bada6e64c7f 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -46,7 +46,9 @@ TcpCubicSender::TcpCubicSender(
largest_acked_sequence_number_(0),
largest_sent_at_last_cutback_(0),
congestion_window_(kInitialCongestionWindow),
+ previous_congestion_window_(0),
slowstart_threshold_(max_tcp_congestion_window),
+ previous_slowstart_threshold_(0),
last_cutback_exited_slowstart_(false),
max_tcp_congestion_window_(max_tcp_congestion_window) {
}
@@ -274,11 +276,25 @@ void TcpCubicSender::MaybeIncreaseCwnd(
void TcpCubicSender::OnRetransmissionTimeout(bool packets_retransmitted) {
largest_sent_at_last_cutback_ = 0;
- if (packets_retransmitted) {
- cubic_.Reset();
- hybrid_slow_start_.Restart();
- congestion_window_ = kMinimumCongestionWindow;
+ if (!packets_retransmitted) {
+ return;
+ }
+ cubic_.Reset();
+ hybrid_slow_start_.Restart();
+ previous_slowstart_threshold_ = slowstart_threshold_;
+ slowstart_threshold_ = congestion_window_ / 2;
+ previous_congestion_window_ = congestion_window_;
+ congestion_window_ = kMinimumCongestionWindow;
+}
+
+void TcpCubicSender::RevertRetransmissionTimeout() {
+ if (previous_congestion_window_ == 0) {
+ LOG(DFATAL) << "No previous congestion window to revert to.";
+ return;
}
+ congestion_window_ = previous_congestion_window_;
+ slowstart_threshold_ = previous_slowstart_threshold_;
+ previous_congestion_window_ = 0;
}
void TcpCubicSender::PrrOnPacketLost(QuicByteCount bytes_in_flight) {
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.h ('k') | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698