Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "7.0.0-prerelease.23309.1",
"version": "7.0.0-prerelease.23321.1",
"commands": [
"xharness"
]
Expand Down
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-9b227c1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-9b227c16/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-9b227c1-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-9b227c16-2/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-9b227c1-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-9b227c16-1/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-96ba1fe" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-96ba1fed/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-fcd8602" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-fcd86021/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,17 @@
<Uri>https://github.com/dotnet/linker</Uri>
<Sha>13a94b5bdc9d01ecd9eb2bd699bd34d597c3ec19</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="7.0.0-prerelease.23309.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="7.0.0-prerelease.23321.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>0627fd5c5d3d1979e3a2234280e47c149c73333a</Sha>
<Sha>08db853202902978dedf7562643a5b29bebf8645</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="7.0.0-prerelease.23309.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="7.0.0-prerelease.23321.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>0627fd5c5d3d1979e3a2234280e47c149c73333a</Sha>
<Sha>08db853202902978dedf7562643a5b29bebf8645</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="7.0.0-prerelease.23309.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="7.0.0-prerelease.23321.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>0627fd5c5d3d1979e3a2234280e47c149c73333a</Sha>
<Sha>08db853202902978dedf7562643a5b29bebf8645</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.PackageTesting" Version="7.0.0-beta.23361.2">
<Uri>https://github.com/dotnet/arcade</Uri>
Expand Down
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@
<!-- Testing -->
<MicrosoftNETCoreCoreDisToolsVersion>1.1.0</MicrosoftNETCoreCoreDisToolsVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>7.0.0-prerelease.23309.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>7.0.0-prerelease.23309.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>7.0.0-prerelease.23309.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>7.0.0-prerelease.23321.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>7.0.0-prerelease.23321.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>7.0.0-prerelease.23321.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>7.0.0-alpha.0.23226.5</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<XUnitVersion>2.4.2</XUnitVersion>
<XUnitAnalyzersVersion>1.0.0</XUnitAnalyzersVersion>
Expand All @@ -179,7 +179,7 @@
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-rtm.23315.2</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicVersion>2.1.1</MicrosoftNativeQuicMsQuicVersion>
<MicrosoftNativeQuicMsQuicVersion>2.2.2</MicrosoftNativeQuicMsQuicVersion>
<SystemNetMsQuicTransportVersion>7.0.0-alpha.1.22459.1</SystemNetMsQuicTransportVersion>
<!-- Mono LLVM -->
<runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.23115.1</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal sealed unsafe partial class MsQuicApi
{
private static readonly Version MinWindowsVersion = new Version(10, 0, 20145, 1000);

private static readonly Version MinMsQuicVersion = new Version(2, 1);
private static readonly Version MinMsQuicVersion = new Version(2, 2, 2);

private static readonly delegate* unmanaged[Cdecl]<uint, QUIC_API_TABLE**, int> MsQuicOpenVersion;
private static readonly delegate* unmanaged[Cdecl]<QUIC_API_TABLE*, void> MsQuicClose;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ internal enum QUIC_STREAM_OPEN_FLAGS
NONE = 0x0000,
UNIDIRECTIONAL = 0x0001,
ZERO_RTT = 0x0002,
DELAY_FC_UPDATES = 0x0004,
}

[System.Flags]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ private unsafe int HandleEventPeerStreamStarted(ref PEER_STREAM_STARTED_DATA dat
stream.Dispose();
return QUIC_STATUS_SUCCESS;
}

data.Flags |= QUIC_STREAM_OPEN_FLAGS.DELAY_FC_UPDATES;
return QUIC_STATUS_SUCCESS;
}
private unsafe int HandleEventPeerCertificateReceived(ref PEER_CERTIFICATE_RECEIVED_DATA data)
Expand Down
45 changes: 42 additions & 3 deletions src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,32 @@ ValueTask<QuicStream> OpenStreamAsync(QuicConnection connection) => unidirection
await serverConnection.DisposeAsync();
}

[Fact]
public async Task OpenStreamAsync_BlocksUntilAvailable_PeerClosesWritingUnidirectional()
{
QuicListenerOptions listenerOptions = new QuicListenerOptions()
{
ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0),
ApplicationProtocols = new List<SslApplicationProtocol>() { ApplicationProtocol },
ConnectionOptionsCallback = (_, _, _) =>
{
var serverOptions = CreateQuicServerOptions();
serverOptions.MaxInboundBidirectionalStreams = 1;
serverOptions.MaxInboundUnidirectionalStreams = 1;
return ValueTask.FromResult(serverOptions);
}
};
(QuicConnection clientConnection, QuicConnection serverConnection) = await CreateConnectedQuicConnection(null, listenerOptions);

// Open one stream, second call should block
await using var stream = await clientConnection.OpenOutboundStreamAsync(QuicStreamType.Unidirectional);
await stream.WriteAsync(new byte[64*1024], completeWrites: true);
await Assert.ThrowsAsync<TimeoutException>(() => clientConnection.OpenOutboundStreamAsync(QuicStreamType.Unidirectional).AsTask().WaitAsync(TimeSpan.FromSeconds(1)));

await clientConnection.DisposeAsync();
await serverConnection.DisposeAsync();
}

[Theory]
[InlineData(false)]
[InlineData(true)]
Expand Down Expand Up @@ -622,11 +648,24 @@ ValueTask<QuicStream> OpenStreamAsync(QuicConnection connection, CancellationTok

// Close the streams, the waitTask should finish as a result.
await stream.DisposeAsync();
QuicStream newStream = await serverConnection.AcceptInboundStreamAsync();
await newStream.DisposeAsync();
// Drain all server streams.
while (true)
{
using var acceptCts = new CancellationTokenSource(TimeSpan.FromSeconds(0.5));
try
{
QuicStream serverStream = await serverConnection.AcceptInboundStreamAsync(acceptCts.Token);
await serverStream.DisposeAsync();
}
catch (OperationCanceledException)
{
// Token expired, no more streams in the server queue, exit the loop.
break;
}
}

// next call should work as intended
newStream = await OpenStreamAsync(clientConnection).AsTask().WaitAsync(TimeSpan.FromSeconds(10));
var newStream = await OpenStreamAsync(clientConnection).AsTask().WaitAsync(TimeSpan.FromSeconds(10));
await newStream.DisposeAsync();

await clientConnection.DisposeAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<NoWarn>CA2252</NoWarn>
</PropertyGroup>
<ItemGroup>
<RdXmlFile Include="default.rd.xml" />
Expand Down