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 @@ -78,12 +78,14 @@ static async ValueTask<QuicConnection> StartConnectAsync(QuicClientConnectionOpt
{
await connection.FinishConnectAsync(options, linkedCts.Token).ConfigureAwait(false);
}
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
catch (OperationCanceledException)
{
// handshake timeout elapsed, tear down the connection.
// Note that since handshake is not done yet, application error code is not sent.
await connection.DisposeAsync().ConfigureAwait(false);

// throw OCE with correct token if cancellation requested by user
cancellationToken.ThrowIfCancellationRequested();

// cancellation by the linkedCts.CancelAfter. Convert to Timeout
throw new QuicException(QuicError.ConnectionTimeout, null, SR.Format(SR.net_quic_handshake_timeout, options.HandshakeTimeout));
}
catch
Expand Down