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

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

Issue 670533004: Fixes two div by zero bugs in QUIC's BBR pacing code that caused server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Simplify_QuicUnackedPacketMap_77986449
Patch Set: Created 6 years, 2 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/congestion_control/rtt_stats_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0a0b6ae38bde0cd8344f5d0194f7639c893fd435..91b95cf29e85f2d6b692c81575bfc2dacc2f90f9 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -98,7 +98,7 @@ void TcpCubicSender::OnCongestionEvent(
const CongestionVector& lost_packets) {
if (rtt_updated && InSlowStart() &&
hybrid_slow_start_.ShouldExitSlowStart(rtt_stats_->latest_rtt(),
- rtt_stats_->min_rtt(),
+ rtt_stats_->MinRtt(),
congestion_window_)) {
slowstart_threshold_ = congestion_window_;
}
@@ -212,6 +212,10 @@ QuicBandwidth TcpCubicSender::PacingRate() const {
}
QuicBandwidth TcpCubicSender::BandwidthEstimate() const {
+ if (rtt_stats_->SmoothedRtt().IsZero()) {
+ LOG(DFATAL) << "In BandwidthEstimate(), smoothed RTT is zero!";
+ return QuicBandwidth::Zero();
+ }
return QuicBandwidth::FromBytesAndTimeDelta(GetCongestionWindow(),
rtt_stats_->SmoothedRtt());
}
@@ -300,7 +304,7 @@ void TcpCubicSender::MaybeIncreaseCwnd(
} else {
congestion_window_ = min(max_tcp_congestion_window_,
cubic_.CongestionWindowAfterAck(
- congestion_window_, rtt_stats_->min_rtt()));
+ congestion_window_, rtt_stats_->MinRtt()));
DVLOG(1) << "Cubic; congestion window: " << congestion_window_
<< " slowstart threshold: " << slowstart_threshold_;
}
« no previous file with comments | « net/quic/congestion_control/rtt_stats_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698