From 3b1231db817a1cf8bc219bf71acffe3598de080e Mon Sep 17 00:00:00 2001 From: Lucas Clemente Date: Mon, 5 Sep 2016 00:57:14 +0200 Subject: [PATCH] remove unused congestion const --- congestion/cubic_sender_test.go | 10 ++++++---- protocol/server_parameters.go | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/congestion/cubic_sender_test.go b/congestion/cubic_sender_test.go index 7477aed5..a7256c87 100644 --- a/congestion/cubic_sender_test.go +++ b/congestion/cubic_sender_test.go @@ -21,6 +21,8 @@ func (c *mockClock) Advance(d time.Duration) { *c = mockClock(time.Time(*c).Add(d)) } +const MaxCongestionWindow = protocol.PacketNumber(200) + var _ = Describe("Cubic Sender", func() { var ( sender SendAlgorithmWithDebugInfo @@ -37,7 +39,7 @@ var _ = Describe("Cubic Sender", func() { ackedPacketNumber = 0 clock = mockClock{} rttStats = NewRTTStats() - sender = NewCubicSender(&clock, rttStats, true /*reno*/, initialCongestionWindowPackets, protocol.MaxCongestionWindow) + sender = NewCubicSender(&clock, rttStats, true /*reno*/, initialCongestionWindowPackets, MaxCongestionWindow) }) SendAvailableSendWindowLen := func(packetLength protocol.ByteCount) int { @@ -380,7 +382,7 @@ var _ = Describe("Cubic Sender", func() { It("RTO congestion window", func() { Expect(sender.GetCongestionWindow()).To(Equal(defaultWindowTCP)) - Expect(sender.SlowstartThreshold()).To(Equal(protocol.MaxCongestionWindow)) + Expect(sender.SlowstartThreshold()).To(Equal(MaxCongestionWindow)) // 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. @@ -789,7 +791,7 @@ var _ = Describe("Cubic Sender", func() { It("reset after connection migration", func() { Expect(sender.GetCongestionWindow()).To(Equal(defaultWindowTCP)) - Expect(sender.SlowstartThreshold()).To(Equal(protocol.MaxCongestionWindow)) + Expect(sender.SlowstartThreshold()).To(Equal(MaxCongestionWindow)) // Starts with slow start. sender.SetNumEmulatedConnections(1) @@ -815,7 +817,7 @@ var _ = Describe("Cubic Sender", func() { // Resets cwnd and slow start threshold on connection migrations. sender.OnConnectionMigration() Expect(sender.GetCongestionWindow()).To(Equal(defaultWindowTCP)) - Expect(sender.SlowstartThreshold()).To(Equal(protocol.MaxCongestionWindow)) + Expect(sender.SlowstartThreshold()).To(Equal(MaxCongestionWindow)) Expect(sender.HybridSlowStart().Started()).To(BeFalse()) }) }) diff --git a/protocol/server_parameters.go b/protocol/server_parameters.go index 81c1294b..7cc1f651 100644 --- a/protocol/server_parameters.go +++ b/protocol/server_parameters.go @@ -2,10 +2,6 @@ package protocol import "time" -// MaxCongestionWindow is the maximum size of the CWND, in packets. -// TODO: Unused? -const MaxCongestionWindow PacketNumber = 200 - // DefaultMaxCongestionWindow is the default for the max congestion window const DefaultMaxCongestionWindow PacketNumber = 1000