Skip to content

Commit b256b43

Browse files
github-actions[bot]TratcherJamesNK
authored
Add endHeader flag to QPACK decode (#62059)
Co-authored-by: Tratcher <[email protected]> Co-authored-by: James Newton-King <[email protected]>
1 parent a2af8ae commit b256b43

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ public void Reset()
176176
_state = State.RequiredInsertCount;
177177
}
178178

179-
public void Decode(in ReadOnlySequence<byte> headerBlock, IHttpHeadersHandler handler)
179+
public void Decode(in ReadOnlySequence<byte> headerBlock, bool endHeaders, IHttpHeadersHandler handler)
180180
{
181181
foreach (ReadOnlyMemory<byte> segment in headerBlock)
182182
{
183-
Decode(segment.Span, handler);
183+
Decode(segment.Span, endHeaders: false, handler);
184184
}
185185
}
186186

187-
public void Decode(ReadOnlySpan<byte> headerBlock, IHttpHeadersHandler handler)
187+
public void Decode(ReadOnlySpan<byte> headerBlock, bool endHeaders, IHttpHeadersHandler handler)
188188
{
189189
foreach (byte b in headerBlock)
190190
{

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -839,8 +839,9 @@ private async ValueTask ReadHeadersAsync(long headersLength, CancellationToken c
839839
}
840840

841841
int processLength = (int)Math.Min(headersLength, _recvBuffer.ActiveLength);
842+
bool endHeaders = headersLength == processLength;
842843

843-
_headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), this);
844+
_headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), endHeaders, this);
844845
_recvBuffer.Discard(processLength);
845846
headersLength -= processLength;
846847
}

0 commit comments

Comments
 (0)