Skip to content

Commit 6042fab

Browse files
authored
Replat on HTTP/3 changes, fixing up minor nits to be compatible with h3-25 (#18912)
1 parent f7dc095 commit 6042fab

File tree

67 files changed

+1644
-1065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1644
-1065
lines changed

src/Servers/Kestrel/Core/ref/Microsoft.AspNetCore.Server.Kestrel.Core.netcoreapp.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ public partial interface IHttpHeadersHandler
239239
{
240240
void OnHeader(System.ReadOnlySpan<byte> name, System.ReadOnlySpan<byte> value);
241241
void OnHeadersComplete(bool endStream);
242+
void OnStaticIndexedHeader(int index);
243+
void OnStaticIndexedHeader(int index, System.ReadOnlySpan<byte> value);
242244
}
243245
public partial interface IHttpRequestLineHandler
244246
{

src/Servers/Kestrel/Core/src/CoreStrings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,4 +581,4 @@ For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?l
581581
<data name="TransportNotFound" xml:space="preserve">
582582
<value>Unable to resolve service for type 'Microsoft.AspNetCore.Connections.IConnectionListenerFactory' while attempting to activate 'Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer'.</value>
583583
</data>
584-
</root>
584+
</root>

src/Servers/Kestrel/Core/src/Internal/Http/Http1ParsingHandler.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,15 @@ public void OnHeadersComplete(bool endStream)
4949

5050
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
5151
=> Connection.OnStartLine(method, version, target, path, query, customMethod, pathEncoded);
52+
53+
public void OnStaticIndexedHeader(int index)
54+
{
55+
throw new NotImplementedException();
56+
}
57+
58+
public void OnStaticIndexedHeader(int index, ReadOnlySpan<byte> value)
59+
{
60+
throw new NotImplementedException();
61+
}
5262
}
5363
}

src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,19 @@ private HttpResponseHeaders CreateResponseHeaders(bool appCompleted)
11921192
}
11931193
}
11941194

1195+
// TODO allow customization of this.
1196+
if (ServerOptions.EnableAltSvc && _httpVersion < Http.HttpVersion.Http3)
1197+
{
1198+
foreach (var option in ServerOptions.ListenOptions)
1199+
{
1200+
if (option.Protocols == HttpProtocols.Http3)
1201+
{
1202+
responseHeaders.HeaderAltSvc = $"h3-25=\":{option.IPEndPoint.Port}\"; ma=84600";
1203+
break;
1204+
}
1205+
}
1206+
}
1207+
11951208
if (ServerOptions.AddServerHeader && !responseHeaders.HasServer)
11961209
{
11971210
responseHeaders.SetRawServer(Constants.ServerName, _bytesServer);

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,16 @@ private async Task ReadInputAsync()
13751375
}
13761376
}
13771377

1378+
public void OnStaticIndexedHeader(int index)
1379+
{
1380+
throw new NotImplementedException();
1381+
}
1382+
1383+
public void OnStaticIndexedHeader(int index, ReadOnlySpan<byte> value)
1384+
{
1385+
throw new NotImplementedException();
1386+
}
1387+
13781388
private class StreamCloseAwaitable : ICriticalNotifyCompletion
13791389
{
13801390
private static readonly Action _callbackCompleted = () => { };

src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3FrameType.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3Frame.Data.cs renamed to src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3RawFrame.Data.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
4+
namespace System.Net.Http
55
{
6-
internal partial class Http3Frame
6+
internal partial class Http3RawFrame
77
{
88
public void PrepareData()
99
{

src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3Frame.GoAway.cs renamed to src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3RawFrame.GoAway.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
4+
namespace System.Net.Http
55
{
6-
internal partial class Http3Frame
6+
internal partial class Http3RawFrame
77
{
88
public void PrepareGoAway()
99
{

src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3Frame.Headers.cs renamed to src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3RawFrame.Headers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
4+
namespace System.Net.Http
55
{
6-
internal partial class Http3Frame
6+
internal partial class Http3RawFrame
77
{
88
public void PrepareHeaders()
99
{

src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3Frame.Settings.cs renamed to src/Servers/Kestrel/Core/src/Internal/Http3/Frames/Http3RawFrame.Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
4+
namespace System.Net.Http
55
{
6-
internal partial class Http3Frame
6+
internal partial class Http3RawFrame
77
{
88
public void PrepareSettings()
99
{

0 commit comments

Comments
 (0)