}
[ConditionalFact(nameof(SupportsAlpn))]
+ public async Task GoAwayFrame_RequestInFlight_Finished()
+ {
+ await Http2LoopbackServer.CreateClientAndServerAsync(async uri =>
+ {
+ using (HttpClient client = CreateHttpClient())
+ {
+ HttpResponseMessage response = await client.GetAsync(uri);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
+ byte[] responseBody = await response.Content.ReadAsByteArrayAsync();
+
+ Assert.Equal(
+ new byte[20]
+ {
+ 5, 4, 3, 2, 1,
+ 11, 10, 9, 8, 7, 6,
+ 15, 14, 13, 12,
+ 20, 19, 18, 17, 16,
+ },
+ responseBody);
+ }
+ },
+ async server =>
+ {
+ Http2LoopbackConnection connection = await server.EstablishConnectionAsync();
+ int streamId = await connection.ReadRequestHeaderAsync();
+
+ await connection.SendDefaultResponseHeadersAsync(streamId);
+
+ await connection.SendResponseBodyAsync(streamId, new byte[5] { 5, 4, 3, 2, 1 }, isFinal: false);
+ await connection.SendResponseBodyAsync(streamId, new byte[6] { 11, 10, 9, 8, 7, 6 }, isFinal: false);
+
+ // Signal that our request is the last thing which will be processed
+ await connection.SendGoAway(streamId);
+
+ // Make sure client received GOAWAY
+ await connection.PingPong();
+
+ await connection.SendResponseBodyAsync(streamId, new byte[4] { 15, 14, 13, 12 }, isFinal: false);
+ await connection.SendResponseBodyAsync(streamId, new byte[5] { 20, 19, 18, 17, 16 }, isFinal: true);
+
+ await connection.WaitForConnectionShutdownAsync();
+ });
+ }
+
+ [ConditionalFact(nameof(SupportsAlpn))]
public async Task DataFrame_TooLong_ConnectionError()
{
using (var server = Http2LoopbackServer.CreateServer())