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

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

Issue 350733006: Fix QUIC's SendAlgorithmSimulator to fix an off by 1 error in the buffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/send_algorithm_simulator.cc
diff --git a/net/quic/congestion_control/send_algorithm_simulator.cc b/net/quic/congestion_control/send_algorithm_simulator.cc
index d539013c10e1109b5f6eaba3c229ed74ed7d6fb5..3b8ca70a8ad7d8bb93b42f7756e8daa7d766a8e2 100644
--- a/net/quic/congestion_control/send_algorithm_simulator.cc
+++ b/net/quic/congestion_control/send_algorithm_simulator.cc
@@ -238,8 +238,8 @@ void SendAlgorithmSimulator::SendDataNow() {
// If the number of bytes in flight are less than the bdp, there's
// no buffering delay. Bytes lost from the buffer are not counted.
QuicByteCount bdp = bandwidth_.ToBytesPerPeriod(rtt_);
- if (sent_packets_.size() * kPacketSize > bdp) {
- QuicByteCount qsize = sent_packets_.size() * kPacketSize - bdp;
+ if ((sent_packets_.size() + 1) * kPacketSize > bdp) {
+ QuicByteCount qsize = (sent_packets_.size() + 1) * kPacketSize - bdp;
ack_time = ack_time.Add(bandwidth_.TransferTime(qsize));
}
// If the packet is lost, give it an ack time of Zero.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698