Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup! Improve exception handling
  • Loading branch information
rzikm committed Apr 11, 2022
commit 08420ff588f128e431ac28db8c8f98532ac71ca0
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ private async ValueTask<QuicStreamProvider> OpenStreamAsync(QUIC_STREAM_OPEN_FLA
throw new InvalidOperationException(SR.net_quic_not_connected);
}

cancellationToken.ThrowIfCancellationRequested();
var stream = new MsQuicStream(_state, flags);

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ internal async ValueTask StartAsync(QUIC_STREAM_START_FLAGS flags, CancellationT
cancellationToken.ThrowIfCancellationRequested();
using CancellationTokenRegistration registration = cancellationToken.UnsafeRegister(static (s, token) =>
{
((State)s!).StartCompletionSource.TrySetCanceled(token);
((State)s!).StartCompletionSource.TrySetException(new OperationCanceledException(token));
}, _state);

uint status = MsQuicApi.Api.StreamStartDelegate(_state.Handle, flags);
Expand Down