Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential Debug.Assert in QuicListener #103965

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ private async void StartConnectionHandshake(QuicConnection connection, SslClient
// https://github.com/microsoft/msquic/discussions/2705.
// This will be assigned to before the linked CTS is cancelled
TimeSpan handshakeTimeout = QuicDefaults.HandshakeTimeout;
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeCts.Token, connection.ConnectionShutdownToken);
try
{
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeCts.Token, connection.ConnectionShutdownToken);
cancellationToken = linkedCts.Token;
// Initial timeout for retrieving connection options.
linkedCts.CancelAfter(handshakeTimeout);
Expand All @@ -249,7 +249,7 @@ private async void StartConnectionHandshake(QuicConnection connection, SslClient
await connection.DisposeAsync().ConfigureAwait(false);
}
}
catch (OperationCanceledException) when (connection.ConnectionShutdownToken.IsCancellationRequested)
catch (OperationCanceledException) when (connection.ConnectionShutdownToken.IsCancellationRequested && !linkedCts.IsCancellationRequested)
{
// Connection closed by peer
if (NetEventSource.Log.IsEnabled())
Expand Down
Loading