forked from quic-go/quic-go
error when receiving stream data with a larger offset than the final offset
This could happen when a peer send a STREAM frame with the Fin bit set, and then sends STREAM frames with a higher offset.
This commit is contained in:
@@ -12,10 +12,12 @@ import (
|
||||
type streamFlowController struct {
|
||||
baseFlowController
|
||||
|
||||
connection connectionFlowControllerI
|
||||
streamID protocol.StreamID
|
||||
|
||||
streamID protocol.StreamID
|
||||
connection connectionFlowControllerI
|
||||
contributesToConnection bool // does the stream contribute to connection level flow control
|
||||
|
||||
receivedFinalOffset bool
|
||||
}
|
||||
|
||||
var _ StreamFlowController = &streamFlowController{}
|
||||
@@ -50,7 +52,12 @@ func (c *streamFlowController) UpdateHighestReceived(byteOffset protocol.ByteCou
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
// TODO(#382): check for StreamDataAfterTermination errors, when receiving an offset after we already received a final offset
|
||||
if c.receivedFinalOffset && byteOffset > c.highestReceived {
|
||||
return qerr.StreamDataAfterTermination
|
||||
}
|
||||
if final {
|
||||
c.receivedFinalOffset = true
|
||||
}
|
||||
if byteOffset == c.highestReceived {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user