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 @@ -754,7 +754,7 @@ private Task ProcessDataFrameAsync(in ReadOnlySequence<byte> payload)
//
// We choose to do that here so we don't have to keep state to track implicitly closed
// streams vs. streams closed with END_STREAM or RST_STREAM.
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.UnknownStream);
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose);
}

private Http2ConnectionErrorException CreateReceivedFrameStreamAbortedException(Http2Stream stream)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(
CoreStrings.FormatHttp2ErrorStreamClosed(Http2FrameType.DATA, streamId: 1),
CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(Http2FrameType.DATA, streamId: 1)
});
AssertConnectionEndReason(ConnectionEndReason.UnknownStream);
AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
}

[Fact]
Expand Down Expand Up @@ -1853,7 +1853,7 @@ await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(
expectedErrorCode: Http2ErrorCode.STREAM_CLOSED,
expectedErrorMessage: CoreStrings.FormatHttp2ErrorStreamClosed(Http2FrameType.DATA, streamId: 1));

AssertConnectionEndReason(ConnectionEndReason.UnknownStream);
AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
}

[Fact]
Expand Down Expand Up @@ -3549,11 +3549,12 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalDataFrames_ConnectionAb
await SendDataAsync(1, new byte[2], endStream: false);
await SendRstStreamAsync(1);
await SendDataAsync(1, new byte[10], endStream: false);
tcs.TrySetResult();

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

tcs.TrySetResult(); // Don't let the response start until after the abort

AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
}

Expand All @@ -3575,11 +3576,12 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalTrailerFrames_Connectio
await SendDataAsync(1, new byte[2], endStream: false);
await SendRstStreamAsync(1);
await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, _requestTrailers);
tcs.TrySetResult();

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

tcs.TrySetResult(); // Don't let the response start until after the abort

AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
}

Expand Down Expand Up @@ -5742,7 +5744,7 @@ await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(
CoreStrings.FormatHttp2ErrorStreamClosed(Http2FrameType.DATA, streamId: 1),
CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(Http2FrameType.DATA, streamId: 1)
});
AssertConnectionEndReason(ConnectionEndReason.UnknownStream);
AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
break;

case Http2FrameType.HEADERS:
Expand Down Expand Up @@ -5833,7 +5835,7 @@ await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(
switch (finalFrameType)
{
case Http2FrameType.DATA:
AssertConnectionEndReason(ConnectionEndReason.UnknownStream);
AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
break;

case Http2FrameType.HEADERS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ await WaitForConnectionErrorAsyncDoNotCloseTransport<Http2ConnectionErrorExcepti
switch (finalFrameType)
{
case Http2FrameType.DATA:
AssertConnectionEndReason(ConnectionEndReason.UnknownStream);
AssertConnectionEndReason(ConnectionEndReason.FrameAfterStreamClose);
break;

case Http2FrameType.CONTINUATION:
Expand Down
Loading