fix handling of duplicate FIN bits after a stream was canceled

This commit is contained in:
Marten Seemann 2019-11-09 10:03:37 +07:00
parent e6e343fc39
commit 63585d1b5e
2 changed files with 23 additions and 2 deletions

View file

@ -236,11 +236,13 @@ func (s *receiveStream) handleStreamFrameImpl(frame *wire.StreamFrame) (bool /*
if err := s.flowController.UpdateHighestReceived(maxOffset, frame.FinBit); err != nil {
return false, err
}
var newlyRcvdFinalOffset bool
if frame.FinBit {
newlyRcvdFinalOffset = s.finalOffset == protocol.MaxByteCount
s.finalOffset = maxOffset
}
if s.canceledRead {
return frame.FinBit, nil
return newlyRcvdFinalOffset, nil
}
if err := s.frameQueue.Push(frame.Data, frame.Offset, frame.PutBack); err != nil {
return false, err