Skip to content
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