diff --git a/internal/congestion/cubic_sender.go b/internal/congestion/cubic_sender.go index 6f3d3289..017d824c 100644 --- a/internal/congestion/cubic_sender.go +++ b/internal/congestion/cubic_sender.go @@ -63,10 +63,9 @@ type cubicSender struct { } var _ SendAlgorithm = &cubicSender{} -var _ SendAlgorithmWithDebugInfo = &cubicSender{} // NewCubicSender makes a new cubic sender -func NewCubicSender(clock Clock, rttStats *RTTStats, reno bool, initialCongestionWindow, initialMaxCongestionWindow protocol.ByteCount) SendAlgorithmWithDebugInfo { +func NewCubicSender(clock Clock, rttStats *RTTStats, reno bool, initialCongestionWindow, initialMaxCongestionWindow protocol.ByteCount) *cubicSender { return &cubicSender{ rttStats: rttStats, initialCongestionWindow: initialCongestionWindow, diff --git a/internal/congestion/cubic_sender_test.go b/internal/congestion/cubic_sender_test.go index de3b74fc..1f1357df 100644 --- a/internal/congestion/cubic_sender_test.go +++ b/internal/congestion/cubic_sender_test.go @@ -26,7 +26,7 @@ const MaxCongestionWindow protocol.ByteCount = 200 * protocol.DefaultTCPMSS var _ = Describe("Cubic Sender", func() { var ( - sender SendAlgorithmWithDebugInfo + sender *cubicSender clock mockClock bytesInFlight protocol.ByteCount packetNumber protocol.PacketNumber diff --git a/internal/congestion/interface.go b/internal/congestion/interface.go index 7c27da64..cccbabbe 100644 --- a/internal/congestion/interface.go +++ b/internal/congestion/interface.go @@ -14,23 +14,5 @@ type SendAlgorithm interface { MaybeExitSlowStart() OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime time.Time) OnPacketLost(number protocol.PacketNumber, lostBytes protocol.ByteCount, priorInFlight protocol.ByteCount) - SetNumEmulatedConnections(n int) OnRetransmissionTimeout(packetsRetransmitted bool) - OnConnectionMigration() - - // Experiments - SetSlowStartLargeReduction(enabled bool) -} - -// SendAlgorithmWithDebugInfo adds some debug functions to SendAlgorithm -type SendAlgorithmWithDebugInfo interface { - SendAlgorithm - BandwidthEstimate() Bandwidth - - // Stuff only used in testing - - HybridSlowStart() *HybridSlowStart - SlowstartThreshold() protocol.ByteCount - RenoBeta() float32 - InRecovery() bool } diff --git a/internal/mocks/congestion.go b/internal/mocks/congestion.go index 774930ea..b9866593 100644 --- a/internal/mocks/congestion.go +++ b/internal/mocks/congestion.go @@ -61,18 +61,6 @@ func (mr *MockSendAlgorithmMockRecorder) MaybeExitSlowStart() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaybeExitSlowStart", reflect.TypeOf((*MockSendAlgorithm)(nil).MaybeExitSlowStart)) } -// OnConnectionMigration mocks base method -func (m *MockSendAlgorithm) OnConnectionMigration() { - m.ctrl.T.Helper() - m.ctrl.Call(m, "OnConnectionMigration") -} - -// OnConnectionMigration indicates an expected call of OnConnectionMigration -func (mr *MockSendAlgorithmMockRecorder) OnConnectionMigration() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnConnectionMigration", reflect.TypeOf((*MockSendAlgorithm)(nil).OnConnectionMigration)) -} - // OnPacketAcked mocks base method func (m *MockSendAlgorithm) OnPacketAcked(arg0 protocol.PacketNumber, arg1, arg2 protocol.ByteCount, arg3 time.Time) { m.ctrl.T.Helper() @@ -121,30 +109,6 @@ func (mr *MockSendAlgorithmMockRecorder) OnRetransmissionTimeout(arg0 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnRetransmissionTimeout", reflect.TypeOf((*MockSendAlgorithm)(nil).OnRetransmissionTimeout), arg0) } -// SetNumEmulatedConnections mocks base method -func (m *MockSendAlgorithm) SetNumEmulatedConnections(arg0 int) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetNumEmulatedConnections", arg0) -} - -// SetNumEmulatedConnections indicates an expected call of SetNumEmulatedConnections -func (mr *MockSendAlgorithmMockRecorder) SetNumEmulatedConnections(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetNumEmulatedConnections", reflect.TypeOf((*MockSendAlgorithm)(nil).SetNumEmulatedConnections), arg0) -} - -// SetSlowStartLargeReduction mocks base method -func (m *MockSendAlgorithm) SetSlowStartLargeReduction(arg0 bool) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetSlowStartLargeReduction", arg0) -} - -// SetSlowStartLargeReduction indicates an expected call of SetSlowStartLargeReduction -func (mr *MockSendAlgorithmMockRecorder) SetSlowStartLargeReduction(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSlowStartLargeReduction", reflect.TypeOf((*MockSendAlgorithm)(nil).SetSlowStartLargeReduction), arg0) -} - // TimeUntilSend mocks base method func (m *MockSendAlgorithm) TimeUntilSend(arg0 protocol.ByteCount) time.Duration { m.ctrl.T.Helper()