Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Implement MaxFrameSize and HeaderTableSize for HTTP/2 #2838

Merged
merged 1 commit into from
Aug 24, 2018

Conversation

JunTaoLuo
Copy link
Contributor

Addresses #2817

@JunTaoLuo JunTaoLuo requested review from halter73 and Tratcher August 21, 2018 23:40
@JunTaoLuo JunTaoLuo force-pushed the johluo/max-frame-size branch from 9fcf9c1 to 1de5817 Compare August 22, 2018 01:43
@@ -89,6 +89,8 @@ public Http2Connection(Http2ConnectionContext context)
_frameWriter = new Http2FrameWriter(context.Transport.Output, context.ConnectionContext, _outputFlowControl, this, context.ConnectionId, context.ServiceContext.Log);
_hpackDecoder = new HPackDecoder((int)_serverSettings.HeaderTableSize);
_serverSettings.MaxConcurrentStreams = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection;
_serverSettings.MaxFrameSize = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxFrameSize;
_incomingFrame = new Http2Frame(_serverSettings.MaxFrameSize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allocates a 16 MB buffer heap allocated buffer per connection... ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea... we haven't really optimized any of this and have been allocating all over the place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 KB by default, but we should definitely used pooled memory for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this now? I think there are tons of allocations everywhere and we should do it systematically at some point. But I suppose we could start piecemeal at a time.

@@ -21,7 +21,7 @@ public Http2ContinuationFrameFlags ContinuationFlags

public void PrepareContinuation(Http2ContinuationFrameFlags flags, int streamId)
{
PayloadLength = MinAllowedMaxFrameSize - HeaderLength;
PayloadLength = (int)_maxFrameSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this since it always has to be set afterwards.

@@ -89,6 +89,8 @@ public Http2Connection(Http2ConnectionContext context)
_frameWriter = new Http2FrameWriter(context.Transport.Output, context.ConnectionContext, _outputFlowControl, this, context.ConnectionId, context.ServiceContext.Log);
_hpackDecoder = new HPackDecoder((int)_serverSettings.HeaderTableSize);
_serverSettings.MaxConcurrentStreams = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection;
_serverSettings.MaxFrameSize = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxFrameSize;
_incomingFrame = new Http2Frame(_serverSettings.MaxFrameSize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 KB by default, but we should definitely used pooled memory for this.

@@ -42,7 +42,7 @@ public void PrepareData(int streamId, byte? padLength = null)
{
var padded = padLength != null;

PayloadLength = MinAllowedMaxFrameSize;
PayloadLength = (int)_maxFrameSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line

@@ -141,7 +141,7 @@ public Http2TestBase()

_echoApplication = async context =>
{
var buffer = new byte[Http2Frame.MinAllowedMaxFrameSize];
var buffer = new byte[Http2Limits.MaxAllowedMaxFrameSize];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinAllowedMaxFrameSize

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a test that I added that needs to echo a data frame that's bigger than the MinAllowedMaxFrameSize and I wanted to reuse the _echoApplication. I could write a separate request delegate so that each test doesn't allocate 16 MB though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I forgot I restructured the test in question so this limit increase is no longer needed.


_clientSettings.Update(_incomingFrame.GetSettings());

if (_clientSettings.MaxFrameSize != previousMaxFrameSize)
{
_frameWriter.UpdateMaxFrameSize(_clientSettings.MaxFrameSize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: do all the business logic either before or after acking. Don't ack in the middle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the ack to the start since there's a comment saying it should be done before updating the window. But I'm curious since I don't see why the current implementation has any downsides?

@@ -64,7 +64,7 @@ public byte HeadersPriorityWeight

public void PrepareHeaders(Http2HeadersFrameFlags flags, int streamId)
{
PayloadLength = MinAllowedMaxFrameSize - HeaderLength;
PayloadLength = (int)_maxFrameSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line

@@ -89,6 +89,8 @@ public Http2Connection(Http2ConnectionContext context)
_frameWriter = new Http2FrameWriter(context.Transport.Output, context.ConnectionContext, _outputFlowControl, this, context.ConnectionId, context.ServiceContext.Log);
_hpackDecoder = new HPackDecoder((int)_serverSettings.HeaderTableSize);
_serverSettings.MaxConcurrentStreams = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection;
_serverSettings.MaxFrameSize = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxFrameSize;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of these conversions between int and uint everywhere. Currently the values on Limits.Http2 are all ints and the values on Http2PeerSettings are uints so we have to convert between the two. We should just pick one and stick to it.

@JunTaoLuo
Copy link
Contributor Author

Also addressing #2816 in the same PR since it's an even smaller change.

@JunTaoLuo JunTaoLuo changed the title Implement MaxFrameSize for HTTP/2 Implement MaxFrameSize and HeaderTableSize for HTTP/2 Aug 23, 2018
_serverSettings.MaxConcurrentStreams = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection;
_serverSettings.MaxFrameSize = (uint)context.ServiceContext.ServerOptions.Limits.Http2.MaxFrameSize;
_serverSettings.HeaderTableSize = (uint)context.ServiceContext.ServerOptions.Limits.Http2.HeaderTableSize;
_hpackDecoder = new HPackDecoder((int)_serverSettings.HeaderTableSize);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no corresponding logic required to handle the HeaderTableSize of the _clientSettings since we are not currently doing header compression in our HPackEncoder. Our HPackEncoder currently does a direct literal encoding without using a compression table or huffman encoding; I should file an issue for that.

@JunTaoLuo JunTaoLuo force-pushed the johluo/max-frame-size branch from 89a37da to 1a02735 Compare August 23, 2018 18:52
@JunTaoLuo
Copy link
Contributor Author

🆙📅

@halter73
Copy link
Member

@davidfowl https://ci3.dot.net/job/aspnet_KestrelHttpServer/job/release_2.2/job/linux-Configuration_Debug_prtest/159/ looks like a regression possibly caused by your recent change.

16:37:36   [xUnit.net 00:00:09.87]     AppCanHandleClientAbortingConnectionMidRequest(listenOptions: http://127.0.0.1:0) [FAIL]
16:37:36   Failed   AppCanHandleClientAbortingConnectionMidRequest(listenOptions: http://127.0.0.1:0)
16:37:36   Error Message:
16:37:36    Moq.MockException : 
16:37:36   Expected invocation on the mock once, but was 0 times: t => t.ConnectionStop(It.IsAny<String>())
16:37:36   No setups configured.
16:37:36   
16:37:36   Performed invocations:
16:37:36   ILogger.IsEnabled(Information)
16:37:36   ILogger.Log<Object>(Debug, 0, [[{OriginalFormat}, TestServer is listening on port 34918]], null, System.Func`3[System.Object,System.Exception,System.String])
16:37:36   IKestrelTrace.ConnectionStart("0HLG9A5H9REP4")
16:37:36   ILogger.IsEnabled(Critical)
16:37:36   ILogger.BeginScope<ConnectionLogScope>([[ConnectionId, 0HLG9A5H9REP4]])
16:37:36   IKestrelTrace.RequestBodyStart("0HLG9A5H9REP4", "0HLG9A5H9REP4:00000001")
16:37:36   IKestrelTrace.ConnectionDisconnect("0HLG9A5H9REP4")
16:37:36   IKestrelTrace.RequestBodyDone("0HLG9A5H9REP4", "0HLG9A5H9REP4:00000001")
16:37:36   IKestrelTrace.ApplicationError("0HLG9A5H9REP4", "0HLG9A5H9REP4:00000001", Microsoft.AspNetCore.Connections.ConnectionResetException: Connection reset by peer ---> System.Net.Sockets.SocketException: Connection reset by peer
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.<GetResult>g__ThrowSocketException|7_0(SocketError e) in /_/src/Kestrel.Transport.Sockets/Internal/SocketAwaitableEventArgs.cs:line 45
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.GetResult() in /_/src/Kestrel.Transport.Sockets/Internal/SocketAwaitableEventArgs.cs:line 38
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.ProcessReceives() in /_/src/Kestrel.Transport.Sockets/Internal/SocketConnection.cs:line 175
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.DoReceive() in /_/src/Kestrel.Transport.Sockets/Internal/SocketConnection.cs:line 120
16:37:36      --- End of inner exception stack trace ---
16:37:36      at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
16:37:36      at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
16:37:36      at System.IO.Pipelines.Pipe.GetReadAsyncResult()
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal.RawStream.ReadAsyncInternal(Memory`1 destination) in /_/src/Kestrel.Core/Adapter/Internal/RawStream.cs:line 122
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal.AdaptedPipeline.ReadInputAsync(Stream stream) in /_/src/Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs:line 135
16:37:36      at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
16:37:36      at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
16:37:36      at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
16:37:36      at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody.PumpAsync() in /_/src/Kestrel.Core/Internal/Http/Http1MessageBody.cs:line 118
16:37:36      at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
16:37:36      at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
16:37:36      at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
16:37:36      at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.CopyToAsync(Stream destination, CancellationToken cancellationToken) in /_/src/Kestrel.Core/Internal/Http/MessageBody.cs:line 86
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.CopyToAsyncInternal(Stream destination, CancellationToken cancellationToken) in /_/src/Kestrel.Core/Internal/Http/HttpRequestStream.cs:line 157
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.RequestTests.<>c__DisplayClass20_0.<<AppCanHandleClientAbortingConnectionMidRequest>b__1>d.MoveNext() in /_/test/Kestrel.Transport.FunctionalTests/RequestTests.cs:line 776
16:37:36   --- End of stack trace from previous location where exception was thrown ---
16:37:36      at Xunit.Assert.RecordExceptionAsync(Func`1 testCode) in C:\Dev\xunit\xunit\src\xunit.assert\Asserts\Record.cs:line 82)
16:37:36   Stack Trace:
16:37:36      at Moq.Mock.ThrowVerifyException(MethodCall expected, IEnumerable`1 setups, IEnumerable`1 actualCalls, Expression expression, Times times, Int32 callCount)
16:37:36      at Moq.Mock.VerifyCalls(Interceptor targetInterceptor, MethodCall expected, Expression expression, Times times)
16:37:36      at Moq.Mock.Verify[T](Mock`1 mock, Expression`1 expression, Times times, String failMessage)
16:37:36      at Moq.Mock`1.Verify(Expression`1 expression, Times times)
16:37:36      at Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.RequestTests.AppCanHandleClientAbortingConnectionMidRequest(ListenOptions listenOptions) in /_/test/Kestrel.Transport.FunctionalTests/RequestTests.cs:line 807
16:37:36   --- End of stack trace from previous location where exception was thrown ---
16:37:36   Standard Output Messages:
16:37:36    | [0.001s] TestLifetime Information: Starting test AppCanHandleClientAbortingConnectionMidRequest-http://127.0.0.1:0 at 2018-08-23T23:37:35
16:37:36    | [0.001s] Microsoft.AspNetCore.Hosting.Internal.WebHost Debug: Hosting starting
16:37:36    | [0.002s] Microsoft.AspNetCore.Hosting.Internal.WebHost Debug: Hosting started
16:37:36    | [0.002s] Microsoft.AspNetCore.Hosting.Internal.WebHost Debug: Loaded hosting startup assembly Sockets.FunctionalTests, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
16:37:36    | [0.002s] Microsoft.AspNetCore.Server.Kestrel Debug: TestServer is listening on port 34918
16:37:36    | [0.003s] Microsoft.AspNetCore.Server.Kestrel Debug: Connection id "0HLG9A5H9REP4" started.
16:37:36    | [0.003s] Microsoft.AspNetCore.Hosting.Internal.WebHost Information: Request starting HTTP/1.1 POST http:///  8192
16:37:36    | [0.003s] Microsoft.AspNetCore.Server.Kestrel Debug: Connection id "0HLG9A5H9REP4", Request id "0HLG9A5H9REP4:00000001": started reading request body.
16:37:36    | [0.009s] Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets Debug: Connection id "0HLG9A5H9REP4" reset.
16:37:36    | [0.009s] Microsoft.AspNetCore.Server.Kestrel Debug: Connection id "0HLG9A5H9REP4" disconnecting.
16:37:36    | [0.010s] Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets Debug: Connection id "0HLG9A5H9REP4" sending FIN.
16:37:36    | [0.010s] Microsoft.AspNetCore.Server.Kestrel Debug: Connection id "0HLG9A5H9REP4", Request id "0HLG9A5H9REP4:00000001": done reading request body.
16:37:36    | [0.010s] Microsoft.AspNetCore.Server.Kestrel Error: Connection id "0HLG9A5H9REP4", Request id "0HLG9A5H9REP4:00000001": An unhandled exception was thrown by the application.
16:37:36    | Microsoft.AspNetCore.Connections.ConnectionResetException: Connection reset by peer ---> System.Net.Sockets.SocketException: Connection reset by peer
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.<GetResult>g__ThrowSocketException|7_0(SocketError e) in /_/src/Kestrel.Transport.Sockets/Internal/SocketAwaitableEventArgs.cs:line 45
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitableEventArgs.GetResult() in /_/src/Kestrel.Transport.Sockets/Internal/SocketAwaitableEventArgs.cs:line 38
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.ProcessReceives() in /_/src/Kestrel.Transport.Sockets/Internal/SocketConnection.cs:line 175
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.DoReceive() in /_/src/Kestrel.Transport.Sockets/Internal/SocketConnection.cs:line 120
16:37:36    |    --- End of inner exception stack trace ---
16:37:36    |    at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
16:37:36    |    at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
16:37:36    |    at System.IO.Pipelines.Pipe.GetReadAsyncResult()
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal.RawStream.ReadAsyncInternal(Memory`1 destination) in /_/src/Kestrel.Core/Adapter/Internal/RawStream.cs:line 122
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal.AdaptedPipeline.ReadInputAsync(Stream stream) in /_/src/Kestrel.Core/Adapter/Internal/AdaptedPipeline.cs:line 135
16:37:36    |    at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
16:37:36    |    at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
16:37:36    |    at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
16:37:36    |    at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody.PumpAsync() in /_/src/Kestrel.Core/Internal/Http/Http1MessageBody.cs:line 118
16:37:36    |    at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
16:37:36    |    at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
16:37:36    |    at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
16:37:36    |    at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.CopyToAsync(Stream destination, CancellationToken cancellationToken) in /_/src/Kestrel.Core/Internal/Http/MessageBody.cs:line 86
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.CopyToAsyncInternal(Stream destination, CancellationToken cancellationToken) in /_/src/Kestrel.Core/Internal/Http/HttpRequestStream.cs:line 157
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.RequestTests.<>c__DisplayClass20_0.<<AppCanHandleClientAbortingConnectionMidRequest>b__1>d.MoveNext() in /_/test/Kestrel.Transport.FunctionalTests/RequestTests.cs:line 776
16:37:36    | --- End of stack trace from previous location where exception was thrown ---
16:37:36    |    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) in /_/src/Kestrel.Core/Internal/Http/HttpProtocol.cs:line 540
16:37:36    | [0.014s] Microsoft.AspNetCore.Hosting.Internal.WebHost Debug: Hosting shutdown
16:37:36    | [0.030s] Microsoft.AspNetCore.Hosting.Internal.WebHost Information: Request finished in 26.977ms 0 
16:37:36    | [0.031s] Microsoft.AspNetCore.Server.Kestrel Debug: Connection id "0HLG9A5H9REP4" stopped.
16:37:36    | [0.062s] TestLifetime Information: Finished test AppCanHandleClientAbortingConnectionMidRequest-http://127.0.0.1:0 in 0.0615109s

Notice that the missing trace, "Connection id "0HLG9A5H9REP4" stopped.", was indeed logged, but not before the mock verification which occurs after the WebHost is disposed. There also aren't any logs indication ungraceful shutdown.

await StartStreamAsync(1, _browserRequestHeaders, endStream: true);

await ExpectAsync(Http2FrameType.HEADERS,
withLength: 16390,
Copy link
Member

@halter73 halter73 Aug 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be calculated from MinAllowedMaxFrameSize?

@JunTaoLuo JunTaoLuo force-pushed the johluo/max-frame-size branch from f45cfe8 to 64127e6 Compare August 24, 2018 18:07
@JunTaoLuo JunTaoLuo merged commit 64127e6 into release/2.2 Aug 24, 2018
@JunTaoLuo JunTaoLuo deleted the johluo/max-frame-size branch August 24, 2018 18:56
Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor cleanup

private int _maxFrameSize = MinAllowedMaxFrameSize;

// These are limits defined by the RFC https://tools.ietf.org/html/rfc7540#section-4.2
public const int MaxAllowedHeaderTableSize = 4096;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these constants public?

They should also be listed above members.

/// <summary>
/// Limits the size of the header compression table, in octets, the HPACK decoder on the server can use.
/// <para>
/// Defaults to 4096
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give the valid range.

// Ack before we update the windows, they could send data immediately.
await _frameWriter.WriteSettingsAckAsync();

if (_clientSettings.MaxFrameSize != previousMaxFrameSize)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do this before writing the settings ack to avoid the async await.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I originally had, but @halter73 wanted it moved.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't you just store the task in a local and return it like before?

_connectionContext.ServiceContext.ServerOptions.Limits.Http2.MaxFrameSize = length;
_connection = new Http2Connection(_connectionContext);

await InitializeConnectionAsync(_echoApplication, expectedSettingsLegnth: 12);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legnth -> Length. And I'd rather it be Count: 3

withLength: 37,
withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS,
withStreamId: 1);
// The client's settings is still defaulted to Http2PeerSettings.MinAllowedMaxFrameSize so the echo response will come back in two separate frames
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment is out of date

public Http2Frame(uint maxFrameSize)
{
_maxFrameSize = maxFrameSize;
_data = new byte[HeaderLength + _maxFrameSize];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be allocating the max size. #2858

@@ -11,6 +11,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core
public class Http2Limits
{
private int _maxStreamsPerConnection = 100;
private int _headerTableSize = MaxAllowedHeaderTableSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Http2PeerSettings.DefaultHeaderTableSize

JunTaoLuo pushed a commit that referenced this pull request Aug 31, 2018
JunTaoLuo pushed a commit that referenced this pull request Sep 7, 2018
JunTaoLuo pushed a commit that referenced this pull request Sep 7, 2018
JunTaoLuo pushed a commit that referenced this pull request Sep 7, 2018
JunTaoLuo pushed a commit that referenced this pull request Sep 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants