forked from quic-go/quic-go
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user