Skip to content
Merged
Changes from 1 commit
Commits
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
Fix test encoder
  • Loading branch information
Tratcher authored and github-actions committed Oct 27, 2022
commit 7a23867c4e16d8e62f52a053835e15c75e620bc9
7 changes: 3 additions & 4 deletions src/Servers/Kestrel/shared/test/Http3/Http3InMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ internal async Task WaitForStreamErrorAsync(Http3ErrorCode protocolError, Action

internal class Http3RequestHeaderHandler
{
public readonly byte[] HeaderEncodingBuffer = new byte[64 * 1024];
public readonly byte[] HeaderEncodingBuffer = new byte[96 * 1024];
public readonly QPackDecoder QpackDecoder = new QPackDecoder(8192);
public readonly Dictionary<string, string> DecodedHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
Expand Down Expand Up @@ -697,10 +697,9 @@ public async Task SendHeadersAsync(Http3HeadersEnumerator headers, bool endStrea

var buffer = _headerHandler.HeaderEncodingBuffer.AsMemory();
var done = QPackHeaderWriter.BeginEncodeHeaders(headers, buffer.Span, ref headersTotalSize, out var length);
while (!done)
if (!done)
{
await SendFrameAsync(Http3FrameType.Headers, buffer.Slice(0, length), endStream: false);
done = QPackHeaderWriter.Encode(headers, buffer.Span, ref headersTotalSize, out length);
throw new InvalidOperationException("The headers are too large.");
}
await SendFrameAsync(Http3FrameType.Headers, buffer.Slice(0, length), endStream);
}
Expand Down