Skip to content
Merged
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 @@ -3588,6 +3588,7 @@ await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(ignoreNonGoAway
[Fact]
public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset()
{
var abortedTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);

var headers = new[]
Expand All @@ -3596,13 +3597,20 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditi
new KeyValuePair<string, string>(InternalHeaderNames.Path, "/"),
new KeyValuePair<string, string>(InternalHeaderNames.Scheme, "http"),
};
await InitializeConnectionAsync(context => tcs.Task);
await InitializeConnectionAsync(context =>
{
context.RequestAborted.Register(() => abortedTcs.TrySetResult());
return tcs.Task;
});

await StartStreamAsync(1, headers, endStream: false);
await SendDataAsync(1, new byte[1], endStream: false);
await SendRstStreamAsync(1);
await SendRstStreamAsync(1);
tcs.TrySetResult();

await abortedTcs.Task;

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

await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false);

Expand Down
Loading