Ack settings before window updates #2772
This commit is contained in:
parent
c73d513289
commit
5378900e0c
|
|
@ -36,7 +36,6 @@ namespace Http2SampleApp
|
|||
options.Listen(IPAddress.Any, basePort, listenOptions =>
|
||||
{
|
||||
listenOptions.Protocols = HttpProtocols.Http1;
|
||||
listenOptions.UseConnectionLogging();
|
||||
});
|
||||
|
||||
// TLS Http/1.1 or HTTP/2 endpoint negotiated via ALPN
|
||||
|
|
@ -44,7 +43,6 @@ namespace Http2SampleApp
|
|||
{
|
||||
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||
listenOptions.UseHttps("testCert.pfx", "testPassword");
|
||||
// listenOptions.UseConnectionLogging();
|
||||
listenOptions.ConnectionAdapters.Add(new TlsFilterAdapter());
|
||||
});
|
||||
|
||||
|
|
@ -53,7 +51,6 @@ namespace Http2SampleApp
|
|||
options.Listen(IPAddress.Any, basePort + 5, listenOptions =>
|
||||
{
|
||||
listenOptions.Protocols = HttpProtocols.Http2;
|
||||
// listenOptions.UseConnectionLogging();
|
||||
});
|
||||
})
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
|
|
|
|||
|
|
@ -608,6 +608,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
|
|||
|
||||
_clientSettings.ParseFrame(_incomingFrame);
|
||||
|
||||
var ackTask = _frameWriter.WriteSettingsAckAsync(); // Ack before we update the windows, they could send data immediately.
|
||||
|
||||
// This difference can be negative.
|
||||
var windowSizeDifference = (int)_clientSettings.InitialWindowSize - previousInitialWindowSize;
|
||||
|
||||
|
|
@ -625,7 +627,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
|
|||
}
|
||||
}
|
||||
|
||||
return _frameWriter.WriteSettingsAckAsync();
|
||||
return ackTask;
|
||||
}
|
||||
catch (Http2SettingsParameterOutOfRangeException ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2328,6 +2328,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
|
|||
_clientSettings.InitialWindowSize += 1;
|
||||
await SendSettingsAsync();
|
||||
|
||||
await ExpectAsync(Http2FrameType.SETTINGS,
|
||||
withLength: 0,
|
||||
withFlags: (byte)Http2SettingsFrameFlags.ACK,
|
||||
withStreamId: 0);
|
||||
|
||||
await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(
|
||||
ignoreNonGoAwayFrames: false,
|
||||
expectedLastStreamId: 1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue