From 8895a79e30d27a073998c9c14a69aec0e839470a Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 23 Jan 2021 16:30:04 +0800 Subject: [PATCH] initialize the slow start threshold to infinity --- internal/congestion/cubic_sender.go | 2 +- internal/congestion/cubic_sender_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/congestion/cubic_sender.go b/internal/congestion/cubic_sender.go index 087cf9294..20a75af26 100644 --- a/internal/congestion/cubic_sender.go +++ b/internal/congestion/cubic_sender.go @@ -83,7 +83,7 @@ func newCubicSender(clock Clock, rttStats *utils.RTTStats, reno bool, initialCon initialMaxCongestionWindow: initialMaxCongestionWindow, congestionWindow: initialCongestionWindow, minCongestionWindow: minCongestionWindow, - slowStartThreshold: initialMaxCongestionWindow, + slowStartThreshold: protocol.MaxByteCount, maxCongestionWindow: initialMaxCongestionWindow, cubic: NewCubic(clock), clock: clock, diff --git a/internal/congestion/cubic_sender_test.go b/internal/congestion/cubic_sender_test.go index 83b4a7002..6836ea99d 100644 --- a/internal/congestion/cubic_sender_test.go +++ b/internal/congestion/cubic_sender_test.go @@ -289,7 +289,7 @@ var _ = Describe("Cubic Sender", func() { It("RTO congestion window", func() { Expect(sender.GetCongestionWindow()).To(Equal(defaultWindowTCP)) - Expect(sender.slowStartThreshold).To(Equal(MaxCongestionWindow)) + Expect(sender.slowStartThreshold).To(Equal(protocol.MaxByteCount)) // Expect the window to decrease to the minimum once the RTO fires // and slow start threshold to be set to 1/2 of the CWND. @@ -420,7 +420,7 @@ var _ = Describe("Cubic Sender", func() { It("reset after connection migration", func() { Expect(sender.GetCongestionWindow()).To(Equal(defaultWindowTCP)) - Expect(sender.slowStartThreshold).To(Equal(MaxCongestionWindow)) + Expect(sender.slowStartThreshold).To(Equal(protocol.MaxByteCount)) // Starts with slow start. const numberOfAcks = 10