diff --git a/mock_stream_manager_test.go b/mock_stream_manager_test.go index 84f30108..44226e02 100644 --- a/mock_stream_manager_test.go +++ b/mock_stream_manager_test.go @@ -123,11 +123,9 @@ func (mr *MockStreamManagerMockRecorder) GetOrOpenSendStream(arg0 interface{}) * } // HandleMaxStreamsFrame mocks base method. -func (m *MockStreamManager) HandleMaxStreamsFrame(arg0 *wire.MaxStreamsFrame) error { +func (m *MockStreamManager) HandleMaxStreamsFrame(arg0 *wire.MaxStreamsFrame) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HandleMaxStreamsFrame", arg0) - ret0, _ := ret[0].(error) - return ret0 + m.ctrl.Call(m, "HandleMaxStreamsFrame", arg0) } // HandleMaxStreamsFrame indicates an expected call of HandleMaxStreamsFrame. diff --git a/session.go b/session.go index 8fe0c637..f581555b 100644 --- a/session.go +++ b/session.go @@ -43,7 +43,7 @@ type streamManager interface { AcceptUniStream(context.Context) (ReceiveStream, error) DeleteStream(protocol.StreamID) error UpdateLimits(*wire.TransportParameters) - HandleMaxStreamsFrame(*wire.MaxStreamsFrame) error + HandleMaxStreamsFrame(*wire.MaxStreamsFrame) CloseWithError(error) } @@ -1181,7 +1181,7 @@ func (s *session) handleFrame(f wire.Frame, encLevel protocol.EncryptionLevel, d case *wire.MaxStreamDataFrame: err = s.handleMaxStreamDataFrame(frame) case *wire.MaxStreamsFrame: - err = s.handleMaxStreamsFrame(frame) + s.handleMaxStreamsFrame(frame) case *wire.DataBlockedFrame: case *wire.StreamDataBlockedFrame: case *wire.StreamsBlockedFrame: @@ -1275,8 +1275,8 @@ func (s *session) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) error return nil } -func (s *session) handleMaxStreamsFrame(frame *wire.MaxStreamsFrame) error { - return s.streamsMap.HandleMaxStreamsFrame(frame) +func (s *session) handleMaxStreamsFrame(frame *wire.MaxStreamsFrame) { + s.streamsMap.HandleMaxStreamsFrame(frame) } func (s *session) handleResetStreamFrame(frame *wire.ResetStreamFrame) error { diff --git a/session_test.go b/session_test.go index 61413e60..60a4aa23 100644 --- a/session_test.go +++ b/session_test.go @@ -247,16 +247,7 @@ var _ = Describe("Session", func() { MaxStreamNum: 10, } streamManager.EXPECT().HandleMaxStreamsFrame(f) - err := sess.handleMaxStreamsFrame(f) - Expect(err).ToNot(HaveOccurred()) - }) - - It("returns errors", func() { - f := &wire.MaxStreamsFrame{MaxStreamNum: 10} - testErr := errors.New("test error") - streamManager.EXPECT().HandleMaxStreamsFrame(f).Return(testErr) - err := sess.handleMaxStreamsFrame(f) - Expect(err).To(MatchError(testErr)) + sess.handleMaxStreamsFrame(f) }) }) diff --git a/streams_map.go b/streams_map.go index 72f68adc..de4d850b 100644 --- a/streams_map.go +++ b/streams_map.go @@ -212,14 +212,13 @@ func (m *streamsMap) getOrOpenSendStream(id protocol.StreamID) (sendStreamI, err panic("") } -func (m *streamsMap) HandleMaxStreamsFrame(f *wire.MaxStreamsFrame) error { +func (m *streamsMap) HandleMaxStreamsFrame(f *wire.MaxStreamsFrame) { switch f.Type { case protocol.StreamTypeUni: m.outgoingUniStreams.SetMaxStream(f.MaxStreamNum) case protocol.StreamTypeBidi: m.outgoingBidiStreams.SetMaxStream(f.MaxStreamNum) } - return nil } func (m *streamsMap) UpdateLimits(p *wire.TransportParameters) { diff --git a/streams_map_test.go b/streams_map_test.go index 27f4703a..0ba630b5 100644 --- a/streams_map_test.go +++ b/streams_map_test.go @@ -363,10 +363,10 @@ var _ = Describe("Streams Map", func() { It("processes IDs for outgoing bidirectional streams", func() { _, err := m.OpenStream() expectTooManyStreamsError(err) - Expect(m.HandleMaxStreamsFrame(&wire.MaxStreamsFrame{ + m.HandleMaxStreamsFrame(&wire.MaxStreamsFrame{ Type: protocol.StreamTypeBidi, MaxStreamNum: 1, - })).To(Succeed()) + }) str, err := m.OpenStream() Expect(err).ToNot(HaveOccurred()) Expect(str.StreamID()).To(Equal(ids.firstOutgoingBidiStream)) @@ -377,10 +377,10 @@ var _ = Describe("Streams Map", func() { It("processes IDs for outgoing unidirectional streams", func() { _, err := m.OpenUniStream() expectTooManyStreamsError(err) - Expect(m.HandleMaxStreamsFrame(&wire.MaxStreamsFrame{ + m.HandleMaxStreamsFrame(&wire.MaxStreamsFrame{ Type: protocol.StreamTypeUni, MaxStreamNum: 1, - })).To(Succeed()) + }) str, err := m.OpenUniStream() Expect(err).ToNot(HaveOccurred()) Expect(str.StreamID()).To(Equal(ids.firstOutgoingUniStream))