mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
pass the version to the receiveStream constructor
This commit is contained in:
parent
d0a394430f
commit
5d45bb046b
3 changed files with 9 additions and 3 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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())
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue