Skip to content

Commit

Permalink
fix accounting for lost RESET_STREAM frames in the send stream (quic-…
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Dec 28, 2024
1 parent 72a934f commit 1ccf2c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions send_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
7 changes: 3 additions & 4 deletions send_stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}

Expand Down

0 comments on commit 1ccf2c3

Please sign in to comment.