Don't ACK ACKs (#2767)
This commit is contained in:
parent
7c8654d443
commit
ec46bc7041
|
|
@ -589,9 +589,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
|
||||||
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdNotZero(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR);
|
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdNotZero(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_incomingFrame.SettingsFlags & Http2SettingsFrameFlags.ACK) == Http2SettingsFrameFlags.ACK && _incomingFrame.Length != 0)
|
if ((_incomingFrame.SettingsFlags & Http2SettingsFrameFlags.ACK) == Http2SettingsFrameFlags.ACK)
|
||||||
{
|
{
|
||||||
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsAckLengthNotZero, Http2ErrorCode.FRAME_SIZE_ERROR);
|
if (_incomingFrame.Length != 0)
|
||||||
|
{
|
||||||
|
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsAckLengthNotZero, Http2ErrorCode.FRAME_SIZE_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_incomingFrame.Length % 6 != 0)
|
if (_incomingFrame.Length % 6 != 0)
|
||||||
|
|
|
||||||
|
|
@ -2217,6 +2217,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
|
||||||
await StopConnectionAsync(expectedLastStreamId: 0, ignoreNonGoAwayFrames: false);
|
await StopConnectionAsync(expectedLastStreamId: 0, ignoreNonGoAwayFrames: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task SETTINGS_ACK_Received_DoesNotSend_ACK()
|
||||||
|
{
|
||||||
|
await InitializeConnectionAsync(_noopApplication);
|
||||||
|
|
||||||
|
var frame = new Http2Frame();
|
||||||
|
frame.PrepareSettings(Http2SettingsFrameFlags.ACK);
|
||||||
|
await SendAsync(frame.Raw);
|
||||||
|
|
||||||
|
await StopConnectionAsync(expectedLastStreamId: 0, ignoreNonGoAwayFrames: false);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task SETTINGS_Received_StreamIdNotZero_ConnectionError()
|
public async Task SETTINGS_Received_StreamIdNotZero_ConnectionError()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue