Skip to content

Commit 9733704

Browse files
authored
Update shared code for HTTP/2 and HTTP/3 (#18958)
1 parent 493da14 commit 9733704

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.Security.Authentication;
1414
using System.Threading;
1515
using System.Threading.Tasks;
16+
using System.Net.Http;
1617
using Microsoft.AspNetCore.Connections;
1718
using Microsoft.AspNetCore.Connections.Features;
1819
using Microsoft.AspNetCore.Hosting.Server;

src/Shared/Http2/IHttpHeadersHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// Don't ever change this unless we are explicitly trying to remove IHttpHeadersHandler as public API.
56
#if KESTREL
67
using System;
78

src/Shared/Http2/ReadMe.SharedCode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ aspnet/AspNetCore code paths:
1414

1515
## Building dotnet/runtime code:
1616
- https://github.com/dotnet/runtime/tree/master/docs/workflow
17-
- Run libraries.cmd from the root once: `PS D:\github\runtime> .\libraries.cmd`
17+
- Run *build.cmd* from the root once: `PS D:\github\runtime> .\build.cmd -subsetCategory libraries`
1818
- Build the individual projects:
1919
- `PS D:\github\dotnet\src\libraries\Common\tests> dotnet msbuild /t:rebuild`
2020
- `PS D:\github\dotnet\src\libraries\System.Net.Http\src> dotnet msbuild /t:rebuild`

src/Shared/Http3/QPack/QPackDecoder.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
using System.Diagnostics;
77
using System.Net.Http.HPack;
88
using System.Numerics;
9+
10+
#if KESTREL
911
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
12+
#endif
1013

1114
namespace System.Net.Http.QPack
1215
{
@@ -221,9 +224,9 @@ private void OnByte(byte b, IHttpHeadersHandler handler)
221224
}
222225
break;
223226
case State.CompressedHeaders:
224-
switch (BitOperations.LeadingZeroCount(b))
227+
switch (BitOperations.LeadingZeroCount(b) - 24)
225228
{
226-
case 24: // Indexed Header Field
229+
case 0: // Indexed Header Field
227230
prefixInt = IndexedHeaderFieldPrefixMask & b;
228231

229232
bool useStaticTable = (b & IndexedHeaderStaticMask) == IndexedHeaderStaticRepresentation;
@@ -242,7 +245,7 @@ private void OnByte(byte b, IHttpHeadersHandler handler)
242245
_state = State.HeaderFieldIndex;
243246
}
244247
break;
245-
case 25: // Literal Header Field With Name Reference
248+
case 1: // Literal Header Field With Name Reference
246249
useStaticTable = (LiteralHeaderFieldStaticMask & b) == LiteralHeaderFieldStaticMask;
247250

248251
if (!useStaticTable)
@@ -260,7 +263,7 @@ private void OnByte(byte b, IHttpHeadersHandler handler)
260263
_state = State.HeaderNameIndex;
261264
}
262265
break;
263-
case 26: // Literal Header Field Without Name Reference
266+
case 2: // Literal Header Field Without Name Reference
264267
_huffman = (b & LiteralHeaderFieldWithoutNameReferenceHuffmanMask) != 0;
265268
prefixInt = b & LiteralHeaderFieldWithoutNameReferencePrefixMask;
266269

@@ -273,7 +276,7 @@ private void OnByte(byte b, IHttpHeadersHandler handler)
273276
_state = State.HeaderNameLength;
274277
}
275278
break;
276-
case 27: // Indexed Header Field With Post-Base Index
279+
case 3: // Indexed Header Field With Post-Base Index
277280
prefixInt = ~PostBaseIndexMask & b;
278281
if (_integerDecoder.BeginTryDecode((byte)prefixInt, PostBaseIndexPrefix, out intResult))
279282
{

src/Shared/Http3/ReadMe.SharedCode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To copy code from aspnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the r
1414
## Building dotnet/runtime code:
1515
- https://github.com/dotnet/runtime/blob/master/docs/libraries/building/windows-instructions.md
1616
- https://github.com/dotnet/runtime/blob/master/docs/libraries/project-docs/developer-guide.md
17-
- Run libraries.cmd from the root once: `PS D:\github\runtime> .\libraries.cmd`
17+
- Run *build.cmd* from the root once: `PS D:\github\runtime> .\build.cmd -subsetCategory libraries`
1818
- Build the individual projects:
1919
- `PS D:\github\dotnet\src\libraries\Common\tests> dotnet msbuild /t:rebuild`
2020
- `PS D:\github\dotnet\src\libraries\System.Net.Http\src> dotnet msbuild /t:rebuild`

0 commit comments

Comments
 (0)