implement sender side behavior for RESET_STREAM_AT (#5242)

* improve existing send stream test

* implement sender side behavior for RESET_STREAM_AT

* refactor send stream cancelation and shutdown error handling

* correctly deal with 0-RTT corner case
This commit is contained in:
Marten Seemann
2025-06-28 11:44:47 +08:00
committed by GitHub
parent b2f24318af
commit a2926a3603
10 changed files with 864 additions and 138 deletions

View File

@@ -71,6 +71,7 @@ func newStream(
streamID protocol.StreamID,
sender streamSender,
flowController flowcontrol.StreamFlowController,
supportsResetStreamAt bool,
) *Stream {
s := &Stream{sender: sender}
senderForSendStream := &uniStreamSender{
@@ -85,7 +86,7 @@ func newStream(
sender.onHasStreamControlFrame(streamID, s)
},
}
s.sendStr = newSendStream(ctx, streamID, senderForSendStream, flowController)
s.sendStr = newSendStream(ctx, streamID, senderForSendStream, flowController, supportsResetStreamAt)
senderForReceiveStream := &uniStreamSender{
streamSender: sender,
onStreamCompletedImpl: func() {
@@ -162,6 +163,10 @@ func (s *Stream) updateSendWindow(limit protocol.ByteCount) {
s.sendStr.updateSendWindow(limit)
}
func (s *Stream) enableResetStreamAt() {
s.sendStr.enableResetStreamAt()
}
func (s *Stream) popStreamFrame(maxBytes protocol.ByteCount, v protocol.Version) (_ ackhandler.StreamFrame, _ *wire.StreamDataBlockedFrame, hasMore bool) {
return s.sendStr.popStreamFrame(maxBytes, v)
}