Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1d41853
Implement dynamic HTTP2 window scaling
antonfirsov Jun 25, 2021
4067443
Merge branch 'main' into http/dynamic-window-02
antonfirsov Jun 25, 2021
a3800d3
actually fix the conflict with #54437
antonfirsov Jun 25, 2021
9f50764
add comment on PING payloads
antonfirsov Jun 25, 2021
3c7c474
delete StringBuilderOutput
antonfirsov Jun 25, 2021
6eb66e9
DisableDynamicWindowSizing: fix name
antonfirsov Jun 25, 2021
4c7f3ac
make RttEstimator.MinRtt thread-safe
antonfirsov Jun 26, 2021
473139d
simplify RuntimeSettingParserTest code
antonfirsov Jun 28, 2021
f2ff4ee
respond to PING while reading CONTINUATION frames in ProcessHeadersFrame
antonfirsov Jun 28, 2021
2bf13e0
fix test
antonfirsov Jun 28, 2021
526d723
add PingBeforeContinuationFrame_Success
antonfirsov Jun 28, 2021
7362e87
WIP: SetupAutomaticPingResponse by default
antonfirsov Jun 30, 2021
4dfcfeb
WIP: SetupAutomaticPingResponse by default
antonfirsov Jun 30, 2021
6e9142b
fix Http2_PingKeepAlive formatting
antonfirsov Jun 30, 2021
e30ab75
delete manual ping response setup code
antonfirsov Jun 30, 2021
20416ac
disallow PING frames before CONTINUATION again
antonfirsov Jun 30, 2021
9f53e0a
move process-wide settings to GlobalHttpSettings & remove MaximumWind…
antonfirsov Jun 30, 2021
13d2066
cleanup defaults
antonfirsov Jun 30, 2021
e6cc7c3
nits
antonfirsov Jun 30, 2021
b89e4bc
reduce footprint of Http2StreamWindowManager & RttEstimator
antonfirsov Jun 30, 2021
1df65a2
comments
antonfirsov Jun 30, 2021
3e18b0b
allow receiving PING ACK after GOAWAY
antonfirsov Jun 30, 2021
fb3b90e
Merge branch 'main' into http/dynamic-window-02
antonfirsov Jun 30, 2021
a54dfdc
nit
antonfirsov Jun 30, 2021
dd8d2cc
defer _lastWindowUpdate = Stopwatch.GetTimestamp()
antonfirsov Jun 30, 2021
4f302c7
delete extra newlines
antonfirsov Jun 30, 2021
e4d8639
remove _respondToPing
antonfirsov Jun 30, 2021
c7761e2
Http2LoopbackConnection: allow PING ACK after GOAWAY
antonfirsov Jun 30, 2021
e23cac8
EnableTransparentPingResponse = false in Http2_PingKeepAlive
antonfirsov Jun 30, 2021
70a04c3
commit suggestion
antonfirsov Jun 30, 2021
ddd6ea1
Merge branch 'main' into http/dynamic-window-02
antonfirsov Jul 1, 2021
7b006a5
sync DiagnosticsHandler with #54437
antonfirsov Jul 1, 2021
bc2b9b5
fix build
antonfirsov Jul 1, 2021
95f9e0d
Apply suggestions
antonfirsov Jul 2, 2021
aba1735
separate _expectPingFrame and _transparentPingResponse functionality
antonfirsov Jul 2, 2021
5cbf0e1
check for _streamWindowSize < MaxStreamWindowSize before trying to ex…
antonfirsov Jul 2, 2021
cd94dcf
nit
antonfirsov Jul 5, 2021
6954f61
move DefaultInitialHttp2StreamWindowSize
antonfirsov Jul 5, 2021
6dbfa47
harden LowBandwidthDelayProduct_ClientStreamReceiveWindowStopsScaling
antonfirsov Jul 5, 2021
3009773
delete unreliable LowBandwidthDelayProduct_ClientStreamReceiveWindowS…
antonfirsov Jul 5, 2021
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
Prev Previous commit
Next Next commit
WIP: SetupAutomaticPingResponse by default
  • Loading branch information
antonfirsov committed Jun 30, 2021
commit 7362e87a4216d82ea2e2441018210304a532c510
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public static async Task<Http2LoopbackConnection> CreateAsync(SocketWrapper sock

var con = new Http2LoopbackConnection(socket, stream, timeout);
await con.ReadPrefixAsync().ConfigureAwait(false);
if (httpOptions.SetupAutomaticPingResponse)
{
con.SetupAutomaticPingResponse();
}

return con;
}
Expand Down Expand Up @@ -308,6 +312,7 @@ public Task<PingFrame> ExpectPingFrameAsync(bool respond = false)
// Starting from the time of the call, respond to all (non-ACK) PING frames which are received among other frames.
public void SetupAutomaticPingResponse()
{
if (_autoProcessPingFrames) return;
_autoProcessPingFrames = true;
_ = ExpectPingFrameAsync(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ public class Http2Options : GenericLoopbackOptions
{
public bool ClientCertificateRequired { get; set; }

public bool SetupAutomaticPingResponse { get; set; } = true;

public Http2Options()
{
SslProtocols = SslProtocols.Tls12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,6 @@ public async Task ResponseStreamFrames_HeadersAfterHeadersAndContinuationWithout
int streamId = await connection.ReadRequestHeaderAsync();

await connection.WriteFrameAsync(MakeSimpleHeadersFrame(streamId, endHeaders: false));
await connection.RespondToPingFrameAsync(); // Respond to 1 RTT PING
await connection.WriteFrameAsync(MakeSimpleContinuationFrame(streamId, endHeaders: false));
await connection.WriteFrameAsync(MakeSimpleHeadersFrame(streamId, endHeaders: false));

Expand All @@ -792,7 +791,6 @@ public async Task ResponseStreamFrames_DataAfterHeadersWithoutEndHeaders_Connect
int streamId = await connection.ReadRequestHeaderAsync();

await connection.WriteFrameAsync(MakeSimpleHeadersFrame(streamId, endHeaders: false));
await connection.RespondToPingFrameAsync(); // Receive 1 RTT PING
await connection.WriteFrameAsync(MakeSimpleDataFrame(streamId));

// As this is a connection level error, the client should see the request fail.
Expand Down Expand Up @@ -838,7 +836,6 @@ public async Task PingBeforeContinuationFrame_Success()

await connection.WriteFrameAsync(MakeSimpleHeadersFrame(streamId, endHeaders: false));

await connection.RespondToPingFrameAsync(); // Respond to 1 RTT PING
await connection.PingPong();

await connection.WriteFrameAsync(MakeSimpleContinuationFrame(streamId, endHeaders: true));
Expand Down Expand Up @@ -898,7 +895,6 @@ public async Task GoAwayFrame_NewRequest_NewConnection()
Http2LoopbackConnection connection2 = await server.EstablishConnectionAsync();
int streamId2 = await connection2.ReadRequestHeaderAsync();
await connection2.SendDefaultResponseAsync(streamId2);
await connection2.RespondToPingFrameAsync(); // Receive 1 RTT PING in response to HEADERS
HttpResponseMessage response2 = await sendTask2;
Assert.Equal(HttpStatusCode.OK, response2.StatusCode);

Expand Down Expand Up @@ -973,7 +969,6 @@ public async Task GoAwayFrame_UnprocessedStreamFirstRequestFinishedFirst_Request
// Complete second request
int streamId3 = await connection2.ReadRequestHeaderAsync();
await connection2.SendDefaultResponseAsync(streamId3);
await connection2.RespondToPingFrameAsync(); // Receive 1 RTT PING in response to HEADERS
HttpResponseMessage response2 = await sendTask2;
Assert.Equal(HttpStatusCode.OK, response2.StatusCode);
await connection2.WaitForConnectionShutdownAsync();
Expand Down Expand Up @@ -1010,7 +1005,6 @@ public async Task GoAwayFrame_UnprocessedStreamFirstRequestWaitsUntilSecondFinis
// Complete second request
int streamId3 = await connection2.ReadRequestHeaderAsync();
await connection2.SendDefaultResponseAsync(streamId3);
await connection2.RespondToPingFrameAsync(); // Expect 1 RTT PING in response to HEADERS
HttpResponseMessage response2 = await sendTask2;
Assert.Equal(HttpStatusCode.OK, response2.StatusCode);
await connection2.WaitForConnectionShutdownAsync();
Expand Down Expand Up @@ -1170,9 +1164,6 @@ public async Task CompletedResponse_WindowUpdateFrameReceived_Success()
// Send empty response.
await connection.SendDefaultResponseAsync(streamId);

// We expect an RTT PING in response to HEADERS:
await connection.RespondToPingFrameAsync();

HttpResponseMessage response = await sendTask;
Assert.Equal(HttpStatusCode.OK, response.StatusCode);

Expand Down Expand Up @@ -1298,9 +1289,6 @@ public async Task GoAwayFrame_NoPendingStreams_ConnectionClosed()
{
(int streamId, Http2LoopbackConnection connection) = await EstablishConnectionAndProcessOneRequestAsync(client, server);

// We expect one RTT PING as a response to HEADERS
await connection.RespondToPingFrameAsync();

// Send GOAWAY.
GoAwayFrame goAwayFrame = new GoAwayFrame(streamId, 0, new byte[0], 0);
await connection.WriteFrameAsync(goAwayFrame);
Expand Down Expand Up @@ -2030,7 +2018,6 @@ public async Task Http2_WaitingForStream_Cancellation()
// Process first request and send response.
int streamId = await connection.ReadRequestHeaderAsync();
await connection.SendDefaultResponseAsync(streamId);
await connection.RespondToPingFrameAsync(); // Handle 1 RTT PING received in response to HEADERS

HttpResponseMessage response = await sendTask;
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Expand Down Expand Up @@ -3395,7 +3382,6 @@ await Http2LoopbackServer.CreateClientAndServerAsync(async url =>
Http2LoopbackConnection connection = await server.EstablishConnectionAsync();
(int streamId, HttpRequestData requestData) = await connection.ReadAndParseRequestHeaderAsync().ConfigureAwait(false);
await connection.SendResponseHeadersAsync(streamId);
await connection.RespondToPingFrameAsync(); // Handle 1 RTT PING in response to HEADERS
await sendAsyncCompleted.Task;
await connection.WaitForConnectionShutdownAsync();
});
Expand Down