Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,13 @@ private Task ProcessRstStreamFrameAsync()
// Second reset
if (stream.RstStreamReceived)
{
// Hard abort, do not allow any more frames on this stream.
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamAborted(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED);
// https://tools.ietf.org/html/rfc7540#section-5.1
// If RST_STREAM has already been received then the stream is in a closed state.
// Additional frames (other than PRIORITY) are a stream error.
// The server will usually send a RST_STREAM for a stream error, but RST_STREAM
// shouldn't be sent in response to RST_STREAM to avoid a loop.
// The best course of action here is to do nothing.
return Task.CompletedTask;
}

// No additional inbound header or data frames are allowed for this stream after receiving a reset.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,7 @@ await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(ignoreNonGoAway
}

[Fact]
public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_ConnectionAborted()
public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset()
{
var tcs = new TaskCompletionSource<int>(TaskCreationOptions.RunContinuationsAsynchronously);

Expand All @@ -3085,8 +3085,7 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_ConnectionAb
await SendRstStreamAsync(1);
tcs.TrySetResult(0);

await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(ignoreNonGoAwayFrames: false, expectedLastStreamId: 1,
Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.RST_STREAM, 1));
await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false);
}

[Fact]
Expand Down