fix accounting for lost RESET_STREAM frames in the send stream (#4804)

This commit is contained in:
Marten Seemann
2024-12-28 17:09:14 +08:00
committed by GitHub
parent 72a934f375
commit 1ccf2c3bff
2 changed files with 4 additions and 4 deletions

View File

@@ -597,6 +597,7 @@ func (s *sendStreamResetStreamHandler) OnAcked(wire.Frame) {
func (s *sendStreamResetStreamHandler) OnLost(wire.Frame) {
s.mutex.Lock()
s.queuedResetStreamFrame = true
s.numOutstandingFrames--
s.mutex.Unlock()
s.sender.onHasStreamControlFrame(s.streamID, (*sendStream)(s))
}

View File

@@ -741,7 +741,7 @@ func TestSendStreamCancellationResetStreamRetransmission(t *testing.T) {
require.False(t, hasMore)
require.True(t, mockCtrl.Satisfied())
// lose the frame
// lose the RESET_STREAM frame
mockSender.EXPECT().onHasStreamControlFrame(streamID, str)
f1.Handler.OnLost(f1.Frame)
// get the retransmission
@@ -751,9 +751,8 @@ func TestSendStreamCancellationResetStreamRetransmission(t *testing.T) {
require.False(t, hasMore)
require.True(t, mockCtrl.Satisfied())
// acknowledge the frame
// TODO(#4803): this should complete the stream, if we correctly accounted for lost RESET_STREAM frames
// mockSender.EXPECT().onStreamCompleted(streamID)
// acknowledging the RESET_STREAM frame completes the stream
mockSender.EXPECT().onStreamCompleted(streamID)
f2.Handler.OnAcked(f2.Frame)
}