Skip to content

Commit 793857f

Browse files
author
John Luo
authored
Merge branch 'master' into johluo/migrating-extensions
2 parents 5f52370 + 04e8b01 commit 793857f

Some content is hidden

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

50 files changed

+5476
-68
lines changed

.github/workflows/ReportDiff.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Check the code is in sync
2+
$changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0
3+
if (-not $changed) { exit }
4+
# Check if tracking issue is open/closed
5+
$Headers = @{ Authorization = 'token {0}' -f $ENV:GITHUB_TOKEN; };
6+
$result = Invoke-RestMethod -Uri $issue
7+
if ($result.state -eq "closed") {
8+
$json = "{ `"state`": `"open`" }"
9+
$result = Invoke-RestMethod -Method PATCH -Headers $Headers -Uri $issue -Body $json
10+
}
11+
# Add a comment
12+
$status = [IO.File]::ReadAllText("artifacts\status.txt")
13+
$diff = [IO.File]::ReadAllText("artifacts\diff.txt")
14+
$body = @"
15+
The shared code is out of sync.
16+
<details>
17+
<summary>The Diff</summary>
18+
19+
``````
20+
$status
21+
$diff
22+
``````
23+
24+
</details>
25+
"@
26+
$json = ConvertTo-Json -InputObject @{ 'body' = $body }
27+
$issue = $issue + '/comments'
28+
$result = Invoke-RestMethod -Method POST -Headers $Headers -Uri $issue -Body $json

.github/workflows/runtime-sync.yml

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,20 @@ jobs:
1717
uses: actions/[email protected]
1818
with:
1919
# Test this script using changes in a fork
20-
# repository: 'Tratcher/aspnetcore'
2120
repository: 'dotnet/aspnetcore'
2221
path: aspnetcore
2322
- name: Checkout runtime
2423
uses: actions/[email protected]
2524
with:
2625
# Test this script using changes in a fork
27-
# repository: 'Tratcher/runtime'
2826
repository: 'dotnet/runtime'
2927
path: runtime
3028
- name: Copy
3129
shell: cmd
3230
working-directory: .\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\
3331
env:
3432
ASPNETCORE_REPO: d:\a\aspnetcore\aspnetcore\aspnetcore\
35-
run: |
36-
dir
37-
CopyToAspNetCore.cmd
33+
run: CopyToAspNetCore.cmd
3834
- name: Diff
3935
shell: cmd
4036
working-directory: .\aspnetcore\
@@ -51,34 +47,6 @@ jobs:
5147
env:
5248
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5349
run: |
54-
# Check the code is in sync
55-
$changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0
56-
if (-not $changed) { exit }
5750
# Test this script using an issue in the local forked repo
58-
# $issue = 'https://api.github.com/repos/Tratcher/aspnetcore/issues/1'
5951
$issue = 'https://api.github.com/repos/dotnet/aspnetcore/issues/18943'
60-
# Check if tracking issue is open/closed
61-
$Headers = @{ Authorization = 'token {0}' -f $ENV:GITHUB_TOKEN; };
62-
$result = Invoke-RestMethod -Uri $issue
63-
if ($result.state -eq "closed") {
64-
$json = "{ `"state`": `"open`" }"
65-
$result = Invoke-RestMethod -Method PATCH -Headers $Headers -Uri $issue -Body $json
66-
}
67-
# Add a comment
68-
$status = [IO.File]::ReadAllText("artifacts\status.txt")
69-
$diff = [IO.File]::ReadAllText("artifacts\diff.txt")
70-
$body = @"
71-
The shared code is out of sync.
72-
<details>
73-
<summary>The Diff</summary>
74-
75-
``````
76-
$status
77-
$diff
78-
``````
79-
80-
</details>
81-
"@
82-
$json = ConvertTo-Json -InputObject @{ 'body' = $body }
83-
$issue = $issue + '/comments'
84-
$result = Invoke-RestMethod -Method POST -Headers $Headers -Uri $issue -Body $json
52+
.\aspnetcore\.github\workflows\ReportDiff.ps1

eng/Version.Details.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,33 @@
2929
<Uri>https://github.com/dotnet/aspnetcore-tooling</Uri>
3030
<Sha>9acda9485be8e2238067508474dfa44fcc34f81e</Sha>
3131
</Dependency>
32-
<Dependency Name="dotnet-ef" Version="5.0.0-preview.1.20113.3">
32+
<Dependency Name="dotnet-ef" Version="5.0.0-preview.2.20120.6">
3333
<Uri>https://github.com/dotnet/efcore</Uri>
34-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
34+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
3535
</Dependency>
36-
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0-preview.1.20113.3">
36+
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0-preview.2.20120.6">
3737
<Uri>https://github.com/dotnet/efcore</Uri>
38-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
38+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
3939
</Dependency>
40-
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0-preview.1.20113.3">
40+
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0-preview.2.20120.6">
4141
<Uri>https://github.com/dotnet/efcore</Uri>
42-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
42+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
4343
</Dependency>
44-
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0-preview.1.20113.3">
44+
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0-preview.2.20120.6">
4545
<Uri>https://github.com/dotnet/efcore</Uri>
46-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
46+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
4747
</Dependency>
48-
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-preview.1.20113.3">
48+
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-preview.2.20120.6">
4949
<Uri>https://github.com/dotnet/efcore</Uri>
50-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
50+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
5151
</Dependency>
52-
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0-preview.1.20113.3">
52+
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0-preview.2.20120.6">
5353
<Uri>https://github.com/dotnet/efcore</Uri>
54-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
54+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
5555
</Dependency>
56-
<Dependency Name="Microsoft.EntityFrameworkCore" Version="5.0.0-preview.1.20113.3">
56+
<Dependency Name="Microsoft.EntityFrameworkCore" Version="5.0.0-preview.2.20120.6">
5757
<Uri>https://github.com/dotnet/efcore</Uri>
58-
<Sha>e3f6eee19b00800855bd2587ebe79f270968fc82</Sha>
58+
<Sha>8f730925a179d31311e1f4dc22bb8d5015488401</Sha>
5959
</Dependency>
6060
<Dependency Name="Microsoft.AspNetCore.Analyzer.Testing" Version="5.0.0-preview.1.20114.1" CoherentParentDependency="Microsoft.AspNetCore.Razor.Language">
6161
<Uri>https://github.com/dotnet/extensions</Uri>

eng/Versions.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@
139139
<MicrosoftExtensionsPrimitivesPackageVersion>5.0.0-preview.1.20114.1</MicrosoftExtensionsPrimitivesPackageVersion>
140140
<MicrosoftInternalExtensionsRefsPackageVersion>5.0.0-preview.1.20114.1</MicrosoftInternalExtensionsRefsPackageVersion>
141141
<!-- Packages from dotnet/efcore -->
142-
<dotnetefPackageVersion>5.0.0-preview.1.20113.3</dotnetefPackageVersion>
143-
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>5.0.0-preview.1.20113.3</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
144-
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>5.0.0-preview.1.20113.3</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
145-
<MicrosoftEntityFrameworkCoreSqlitePackageVersion>5.0.0-preview.1.20113.3</MicrosoftEntityFrameworkCoreSqlitePackageVersion>
146-
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>5.0.0-preview.1.20113.3</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
147-
<MicrosoftEntityFrameworkCoreToolsPackageVersion>5.0.0-preview.1.20113.3</MicrosoftEntityFrameworkCoreToolsPackageVersion>
148-
<MicrosoftEntityFrameworkCorePackageVersion>5.0.0-preview.1.20113.3</MicrosoftEntityFrameworkCorePackageVersion>
142+
<dotnetefPackageVersion>5.0.0-preview.2.20120.6</dotnetefPackageVersion>
143+
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>5.0.0-preview.2.20120.6</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
144+
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>5.0.0-preview.2.20120.6</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
145+
<MicrosoftEntityFrameworkCoreSqlitePackageVersion>5.0.0-preview.2.20120.6</MicrosoftEntityFrameworkCoreSqlitePackageVersion>
146+
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>5.0.0-preview.2.20120.6</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
147+
<MicrosoftEntityFrameworkCoreToolsPackageVersion>5.0.0-preview.2.20120.6</MicrosoftEntityFrameworkCoreToolsPackageVersion>
148+
<MicrosoftEntityFrameworkCorePackageVersion>5.0.0-preview.2.20120.6</MicrosoftEntityFrameworkCorePackageVersion>
149149
<!-- Packages from dotnet/aspnetcore-tooling -->
150150
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>5.0.0-preview.1.20114.5</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
151151
<MicrosoftAspNetCoreRazorLanguagePackageVersion>5.0.0-preview.1.20114.5</MicrosoftAspNetCoreRazorLanguagePackageVersion>

src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Core components of ASP.NET Core Kestrel cross-platform web server.</Description>
@@ -16,7 +16,9 @@
1616
<Compile Include="$(SharedSourceRoot)CertificateGeneration\**\*.cs" />
1717
<Compile Include="$(SharedSourceRoot)ValueTaskExtensions\**\*.cs" />
1818
<Compile Include="$(SharedSourceRoot)UrlDecoder\**\*.cs" />
19-
<Compile Include="$(SharedSourceRoot)runtime\**\*.cs" LinkBase="Shared\runtime\" />
19+
<Compile Include="$(SharedSourceRoot)runtime\*.cs" Link="Shared\runtime\%(Filename)%(Extension)"/>
20+
<Compile Include="$(SharedSourceRoot)runtime\Http2\**\*.cs" Link="Shared\runtime\Http2\%(Filename)%(Extension)"/>
21+
<Compile Include="$(SharedSourceRoot)runtime\Http3\**\*.cs" Link="Shared\runtime\Http3\%(Filename)%(Extension)"/>
2022
<Compile Include="$(SharedSourceRoot)ServerInfrastructure\**\*.cs" LinkBase="Shared\" />
2123
<Compile Include="$(RepoRoot)src\Shared\TaskToApm.cs" Link="Internal\TaskToApm.cs" />
2224
</ItemGroup>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
internal static partial class Interop
6+
{
7+
internal static class Libraries
8+
{
9+
// Compare to https://github.com/dotnet/runtime/blob/63c88901df460c47eaffc6b970c4b5f0aeaf0a88/src/libraries/Common/src/Interop/Linux/Interop.Libraries.cs#L10
10+
internal const string MsQuic = "msquic";
11+
}
12+
}
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Description>Libuv transport for the ASP.NET Core Kestrel cross-platform web server.</Description>
4+
<Description>Quic transport for the ASP.NET Core Kestrel cross-platform web server.</Description>
55
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<PackageTags>aspnetcore;kestrel</PackageTags>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
9-
<NoWarn>CS1591;$(NoWarn)</NoWarn>
9+
<NoWarn>CS1591;CS0436;$(NoWarn)</NoWarn><!-- Conflicts between internal and public Quic APIs -->
1010
<IsShippingPackage>false</IsShippingPackage>
1111
</PropertyGroup>
1212

1313
<ItemGroup>
1414
<Compile Include="$(RepoRoot)src\Shared\Buffers.MemoryPool\*.cs" LinkBase="MemoryPool" />
1515
<Compile Include="$(KestrelSharedSourceRoot)\CorrelationIdGenerator.cs" Link="Internal\CorrelationIdGenerator.cs" />
1616
<Compile Include="$(SharedSourceRoot)ServerInfrastructure\DuplexPipe.cs" Link="Internal\DuplexPipe.cs" />
17+
<Compile Include="$(SharedSourceRoot)runtime\NetEventSource.Common.cs" Link="Shared\runtime\%(Filename)%(Extension)"/>
18+
<Compile Include="$(SharedSourceRoot)runtime\SR.Quic.cs" Link="Shared\runtime\%(Filename)%(Extension)"/>
19+
<Compile Include="$(SharedSourceRoot)runtime\Quic\**\*.cs" Link="Shared\runtime\Quic\%(Filename)%(Extension)" />
1720
<Compile Include="$(KestrelSharedSourceRoot)\TransportConnection.cs" Link="Internal\TransportConnection.cs" />
1821
<Compile Include="$(KestrelSharedSourceRoot)\TransportConnection.Generated.cs" Link="Internal\TransportConnection.Generated.cs" />
1922
<Compile Include="$(KestrelSharedSourceRoot)\TransportConnection.FeatureCollection.cs" Link="Internal\TransportConnection.FeatureCollection.cs" />
23+
<Compile Include="$(RepoRoot)src\Shared\TaskToApm.cs" Link="Internal\TaskToApm.cs" />
2024
</ItemGroup>
2125

2226
<ItemGroup>
@@ -26,4 +30,11 @@
2630
<Reference Include="Microsoft.Extensions.Options" />
2731
</ItemGroup>
2832

33+
<ItemGroup>
34+
<EmbeddedResource Include="$(SharedSourceRoot)runtime\SR.resx" Link="Shared\runtime\SR.resx">
35+
<ManifestResourceName>System.Net.Quic.SR</ManifestResourceName>
36+
<Generator></Generator>
37+
</EmbeddedResource>
38+
</ItemGroup>
39+
2940
</Project>

src/Shared/runtime/Http2/Hpack/HPackDecoder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace System.Net.Http.HPack
1212
{
1313
internal class HPackDecoder
1414
{
15-
private enum State
15+
private enum State : byte
1616
{
1717
Ready,
1818
HeaderFieldIndex,

src/Shared/runtime/Http2/Hpack/HeaderField.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ public HeaderField(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
2121
// We should revisit our allocation strategy here so we don't need to allocate per entry
2222
// and we have a cap to how much allocation can happen per dynamic table
2323
// (without limiting the number of table entries a server can provide within the table size limit).
24-
Name = new byte[name.Length];
25-
name.CopyTo(Name);
26-
27-
Value = new byte[value.Length];
28-
value.CopyTo(Value);
24+
Name = name.ToArray();
25+
Value = value.ToArray();
2926
}
3027

3128
public byte[] Name { get; }

src/Shared/runtime/Http3/QPack/QPackDecoder.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ private void OnByte(byte b, IHttpHeadersHandler handler)
269269

270270
if (_integerDecoder.BeginTryDecode((byte)prefixInt, LiteralHeaderFieldWithoutNameReferencePrefix, out intResult))
271271
{
272+
if (intResult == 0)
273+
{
274+
throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, ""));
275+
}
272276
OnStringLength(intResult, State.HeaderName);
273277
}
274278
else
@@ -303,6 +307,10 @@ private void OnByte(byte b, IHttpHeadersHandler handler)
303307
case State.HeaderNameLength:
304308
if (_integerDecoder.TryDecode(b, out intResult))
305309
{
310+
if (intResult == 0)
311+
{
312+
throw new QPackDecodingException(SR.Format(SR.net_http_invalid_header_name, ""));
313+
}
306314
OnStringLength(intResult, nextState: State.HeaderName);
307315
}
308316
break;

0 commit comments

Comments
 (0)