forked from quic-go/quic-go
copy error code from the STOP_SENDING frame to the RESET_STREAM frame
This commit is contained in:
@@ -296,7 +296,7 @@ func (s *sendStream) handleStopSendingFrameImpl(frame *wire.StopSendingFrame) bo
|
||||
errorCode: frame.ErrorCode,
|
||||
error: fmt.Errorf("Stream %d was reset with error code %d", s.streamID, frame.ErrorCode),
|
||||
}
|
||||
return s.cancelWriteImpl(errorCodeStopping, writeErr)
|
||||
return s.cancelWriteImpl(frame.ErrorCode, writeErr)
|
||||
}
|
||||
|
||||
func (s *sendStream) Context() context.Context {
|
||||
|
||||
@@ -609,10 +609,10 @@ var _ = Describe("Send Stream", func() {
|
||||
})
|
||||
|
||||
Context("receiving STOP_SENDING frames", func() {
|
||||
It("queues a RESET_STREAM frames with error code Stopping", func() {
|
||||
It("queues a RESET_STREAM frames, and copies the error code from the STOP_SENDING frame", func() {
|
||||
mockSender.EXPECT().queueControlFrame(&wire.ResetStreamFrame{
|
||||
StreamID: streamID,
|
||||
ErrorCode: errorCodeStopping,
|
||||
ErrorCode: 101,
|
||||
})
|
||||
mockSender.EXPECT().onStreamCompleted(streamID)
|
||||
str.handleStopSendingFrame(&wire.StopSendingFrame{
|
||||
|
||||
Reference in New Issue
Block a user