Skip to content

Commit 1edae9f

Browse files
authored
Revert "Fix potential Debug.Assert in QuicListener (#103965)"
This reverts commit 2fab73c.
1 parent e5d9a3d commit 1edae9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ private async void StartConnectionHandshake(QuicConnection connection, SslClient
225225
// https://github.com/microsoft/msquic/discussions/2705.
226226
// This will be assigned to before the linked CTS is cancelled
227227
TimeSpan handshakeTimeout = QuicDefaults.HandshakeTimeout;
228-
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeCts.Token, connection.ConnectionShutdownToken);
229228
try
230229
{
230+
using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_disposeCts.Token, connection.ConnectionShutdownToken);
231231
cancellationToken = linkedCts.Token;
232232
// Initial timeout for retrieving connection options.
233233
linkedCts.CancelAfter(handshakeTimeout);
@@ -249,7 +249,7 @@ private async void StartConnectionHandshake(QuicConnection connection, SslClient
249249
await connection.DisposeAsync().ConfigureAwait(false);
250250
}
251251
}
252-
catch (OperationCanceledException) when (connection.ConnectionShutdownToken.IsCancellationRequested && !linkedCts.IsCancellationRequested)
252+
catch (OperationCanceledException) when (connection.ConnectionShutdownToken.IsCancellationRequested)
253253
{
254254
// Connection closed by peer
255255
if (NetEventSource.Log.IsEnabled())

0 commit comments

Comments
 (0)