diff --git a/internal/handshake/crypto_setup.go b/internal/handshake/crypto_setup.go index 1fe6c340..b0859d8b 100644 --- a/internal/handshake/crypto_setup.go +++ b/internal/handshake/crypto_setup.go @@ -223,7 +223,7 @@ func (h *cryptoSetup) ChangeConnectionID(id protocol.ConnectionID) error { return nil } -func (h *cryptoSetup) Received1RTTAck() { +func (h *cryptoSetup) SetLargest1RTTAcked(_ protocol.PacketNumber) { // drop initial keys // TODO: do this earlier if h.initialOpener != nil { diff --git a/internal/handshake/interface.go b/internal/handshake/interface.go index 07152c1f..55bc035d 100644 --- a/internal/handshake/interface.go +++ b/internal/handshake/interface.go @@ -71,7 +71,7 @@ type CryptoSetup interface { ChangeConnectionID(protocol.ConnectionID) error HandleMessage([]byte, protocol.EncryptionLevel) bool - Received1RTTAck() + SetLargest1RTTAcked(protocol.PacketNumber) ConnectionState() tls.ConnectionState GetInitialOpener() (LongHeaderOpener, error) diff --git a/internal/mocks/crypto_setup.go b/internal/mocks/crypto_setup.go index 77ed0bed..38449457 100644 --- a/internal/mocks/crypto_setup.go +++ b/internal/mocks/crypto_setup.go @@ -182,18 +182,6 @@ func (mr *MockCryptoSetupMockRecorder) HandleMessage(arg0, arg1 interface{}) *go return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleMessage", reflect.TypeOf((*MockCryptoSetup)(nil).HandleMessage), arg0, arg1) } -// Received1RTTAck mocks base method -func (m *MockCryptoSetup) Received1RTTAck() { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Received1RTTAck") -} - -// Received1RTTAck indicates an expected call of Received1RTTAck -func (mr *MockCryptoSetupMockRecorder) Received1RTTAck() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Received1RTTAck", reflect.TypeOf((*MockCryptoSetup)(nil).Received1RTTAck)) -} - // RunHandshake mocks base method func (m *MockCryptoSetup) RunHandshake() { m.ctrl.T.Helper() @@ -205,3 +193,15 @@ func (mr *MockCryptoSetupMockRecorder) RunHandshake() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunHandshake", reflect.TypeOf((*MockCryptoSetup)(nil).RunHandshake)) } + +// SetLargest1RTTAcked mocks base method +func (m *MockCryptoSetup) SetLargest1RTTAcked(arg0 protocol.PacketNumber) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetLargest1RTTAcked", arg0) +} + +// SetLargest1RTTAcked indicates an expected call of SetLargest1RTTAcked +func (mr *MockCryptoSetupMockRecorder) SetLargest1RTTAcked(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLargest1RTTAcked", reflect.TypeOf((*MockCryptoSetup)(nil).SetLargest1RTTAcked), arg0) +} diff --git a/session.go b/session.go index d92f70c5..8b8939a2 100644 --- a/session.go +++ b/session.go @@ -50,7 +50,7 @@ type streamManager interface { type cryptoStreamHandler interface { RunHandshake() ChangeConnectionID(protocol.ConnectionID) error - Received1RTTAck() + SetLargest1RTTAcked(protocol.PacketNumber) io.Closer ConnectionState() tls.ConnectionState } @@ -890,7 +890,7 @@ func (s *session) handleAckFrame(frame *wire.AckFrame, pn protocol.PacketNumber, } if encLevel == protocol.Encryption1RTT { s.receivedPacketHandler.IgnoreBelow(s.sentPacketHandler.GetLowestPacketNotConfirmedAcked()) - s.cryptoStreamHandler.Received1RTTAck() + s.cryptoStreamHandler.SetLargest1RTTAcked(frame.LargestAcked()) } return nil } diff --git a/session_test.go b/session_test.go index 5399f938..03f2ebdf 100644 --- a/session_test.go +++ b/session_test.go @@ -163,7 +163,7 @@ var _ = Describe("Session", func() { }) It("tells the ReceivedPacketHandler to ignore low ranges", func() { - cryptoSetup.EXPECT().Received1RTTAck() + cryptoSetup.EXPECT().SetLargest1RTTAcked(protocol.PacketNumber(3)) ack := &wire.AckFrame{AckRanges: []wire.AckRange{{Smallest: 2, Largest: 3}}} sph := mockackhandler.NewMockSentPacketHandler(mockCtrl) sph.EXPECT().ReceivedAck(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any())