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

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

Issue 687883002: Protect UpdateRTT from negative send deltas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Protect_against_divide_by_zero_78578198
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 | « no previous file | net/quic/congestion_control/rtt_stats_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/rtt_stats.cc
diff --git a/net/quic/congestion_control/rtt_stats.cc b/net/quic/congestion_control/rtt_stats.cc
index 9b1e9470024b79bdb210d4aa2ac1535925713778..7b25b6c6d373268a76a2085e4f20b056d859e41d 100644
--- a/net/quic/congestion_control/rtt_stats.cc
+++ b/net/quic/congestion_control/rtt_stats.cc
@@ -53,9 +53,10 @@ void RttStats::ExpireSmoothedMetrics() {
void RttStats::UpdateRtt(QuicTime::Delta send_delta,
QuicTime::Delta ack_delay,
QuicTime now) {
- if (send_delta.IsInfinite() || send_delta.IsZero()) {
- DVLOG(1) << "Ignoring measured send_delta, because it's "
- << (send_delta.IsZero() ? "Zero" : "Infinite");
+ if (send_delta.IsInfinite() || send_delta <= QuicTime::Delta::Zero()) {
+ LOG(WARNING) << "Ignoring measured send_delta, because it's is "
+ << "either infinite, zero, or negative. send_delta = "
+ << send_delta.ToMicroseconds();
return;
}
« no previous file with comments | « no previous file | net/quic/congestion_control/rtt_stats_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698