forked from quic-go/quic-go
handle MAX_STREAM_DATA frames for the crypto stream
This commit is contained in:
@@ -582,6 +582,10 @@ func (s *session) handleMaxDataFrame(frame *wire.MaxDataFrame) {
|
||||
}
|
||||
|
||||
func (s *session) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) error {
|
||||
if frame.StreamID == s.version.CryptoStreamID() {
|
||||
s.cryptoStream.UpdateSendWindow(frame.ByteOffset)
|
||||
return nil
|
||||
}
|
||||
str, err := s.streamsMap.GetOrOpenStream(frame.StreamID)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -393,6 +393,18 @@ var _ = Describe("Session", func() {
|
||||
sess.connFlowController = connFC
|
||||
})
|
||||
|
||||
It("updates the flow control window of the crypto stream", func() {
|
||||
fc := mocks.NewMockStreamFlowController(mockCtrl)
|
||||
offset := protocol.ByteCount(0x4321)
|
||||
fc.EXPECT().UpdateSendWindow(offset)
|
||||
sess.cryptoStream.(*stream).flowController = fc
|
||||
err := sess.handleMaxStreamDataFrame(&wire.MaxStreamDataFrame{
|
||||
StreamID: sess.version.CryptoStreamID(),
|
||||
ByteOffset: offset,
|
||||
})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("updates the flow control window of a stream", func() {
|
||||
offset := protocol.ByteCount(0x1234)
|
||||
str, err := sess.GetOrOpenStream(5)
|
||||
|
||||
Reference in New Issue
Block a user