forked from quic-go/quic-go
pass the byte offset of a RstStreamFrame to the flow controller
fixes #377
This commit is contained in:
@@ -317,6 +317,30 @@ var _ = Describe("Session", func() {
|
||||
Expect(err).To(MatchError("RST_STREAM received with code 42"))
|
||||
})
|
||||
|
||||
It("passes the byte offset to the flow controller", func() {
|
||||
session.streamsMap.GetOrOpenStream(5)
|
||||
session.flowControlManager = newMockFlowControlHandler()
|
||||
err := session.handleRstStreamFrame(&frames.RstStreamFrame{
|
||||
StreamID: 5,
|
||||
ByteOffset: 0x1337,
|
||||
})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(session.flowControlManager.(*mockFlowControlHandler).highestReceivedForStream).To(Equal(protocol.StreamID(5)))
|
||||
Expect(session.flowControlManager.(*mockFlowControlHandler).highestReceived).To(Equal(protocol.ByteCount(0x1337)))
|
||||
})
|
||||
|
||||
It("returns errors from the flow controller", func() {
|
||||
session.streamsMap.GetOrOpenStream(5)
|
||||
session.flowControlManager = newMockFlowControlHandler()
|
||||
testErr := errors.New("flow control violation")
|
||||
session.flowControlManager.(*mockFlowControlHandler).flowControlViolation = testErr
|
||||
err := session.handleRstStreamFrame(&frames.RstStreamFrame{
|
||||
StreamID: 5,
|
||||
ByteOffset: 0x1337,
|
||||
})
|
||||
Expect(err).To(MatchError(testErr))
|
||||
})
|
||||
|
||||
It("ignores the error when the stream is not known", func() {
|
||||
err := session.handleFrames([]frames.Frame{&frames.RstStreamFrame{
|
||||
StreamID: 5,
|
||||
|
||||
Reference in New Issue
Block a user