diff --git a/receive_stream.go b/receive_stream.go index f793981f..9ae216f6 100644 --- a/receive_stream.go +++ b/receive_stream.go @@ -55,6 +55,7 @@ func newReceiveStream( streamID protocol.StreamID, sender streamSender, flowController flowcontrol.StreamFlowController, + version protocol.VersionNumber, ) *receiveStream { return &receiveStream{ streamID: streamID, @@ -62,6 +63,7 @@ func newReceiveStream( flowController: flowController, frameQueue: newStreamFrameSorter(), readChan: make(chan struct{}, 1), + version: version, } } diff --git a/receive_stream_test.go b/receive_stream_test.go index a6ac9f85..4a3e04e4 100644 --- a/receive_stream_test.go +++ b/receive_stream_test.go @@ -29,7 +29,7 @@ var _ = Describe("Receive Stream", func() { BeforeEach(func() { mockSender = NewMockStreamSender(mockCtrl) mockFC = mocks.NewMockStreamFlowController(mockCtrl) - str = newReceiveStream(streamID, mockSender, mockFC) + str = newReceiveStream(streamID, mockSender, mockFC, versionIETFFrames) timeout := scaleDuration(250 * time.Millisecond) strWithTimeout = gbytes.TimeoutReader(str, timeout) @@ -494,6 +494,7 @@ var _ = Describe("Receive Stream", func() { }) It("queues a STOP_SENDING frame, for IETF QUIC", func() { + str.version = versionIETFFrames mockSender.EXPECT().queueControlFrame(&wire.StopSendingFrame{ StreamID: streamID, ErrorCode: 1234, @@ -503,7 +504,10 @@ var _ = Describe("Receive Stream", func() { }) It("doesn't queue a STOP_SENDING frame, for gQUIC", func() { - + str.version = versionGQUICFrames + // no calls to mockSender.queueControlFrame + err := str.CancelRead(1234) + Expect(err).ToNot(HaveOccurred()) }) }) diff --git a/stream.go b/stream.go index 6a4c6ce5..83123493 100644 --- a/stream.go +++ b/stream.go @@ -125,7 +125,7 @@ func newStream(streamID protocol.StreamID, s.completedMutex.Unlock() }, } - s.receiveStream = *newReceiveStream(streamID, senderForReceiveStream, flowController) + s.receiveStream = *newReceiveStream(streamID, senderForReceiveStream, flowController, version) return s }