diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicConnection.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicConnection.cs index 0fdecc68af8d..b7bd07d901da 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicConnection.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicConnection.cs @@ -89,7 +89,7 @@ internal override IPEndPoint LocalEndPoint internal async ValueTask SetSecurityConfigForConnection(X509Certificate cert, string? certFilePath, string? privateKeyFilePath) { - _securityConfig = await MsQuicApi.Api.CreateSecurityConfig(cert, certFilePath, privateKeyFilePath); + _securityConfig = await MsQuicApi.Api.CreateSecurityConfig(cert, certFilePath, privateKeyFilePath).ConfigureAwait(false); // TODO this isn't being set correctly MsQuicParameterHelpers.SetSecurityConfig(MsQuicApi.Api, _ptr, (uint)QUIC_PARAM_LEVEL.CONNECTION, (uint)QUIC_PARAM_CONN.SEC_CONFIG, _securityConfig!.NativeObjPtr); } diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicListener.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicListener.cs index e87126b87f0e..2418a71ed6bf 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicListener.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicListener.cs @@ -80,7 +80,7 @@ internal override async ValueTask AcceptConnectionAsync( await connection.SetSecurityConfigForConnection(_sslOptions.ServerCertificate!, _options.CertificateFilePath, - _options.PrivateKeyFilePath); + _options.PrivateKeyFilePath).ConfigureAwait(false); if (NetEventSource.IsEnabled) NetEventSource.Exit(this); return connection; diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs index b8b6282a25c1..6eed08f02de8 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/MsQuicStream.cs @@ -129,9 +129,9 @@ internal override async ValueTask WriteAsync(ReadOnlySequence buffers, boo ThrowIfDisposed(); - using CancellationTokenRegistration registration = await HandleWriteStartState(cancellationToken); + using CancellationTokenRegistration registration = await HandleWriteStartState(cancellationToken).ConfigureAwait(false); - await SendReadOnlySequenceAsync(buffers, endStream ? QUIC_SEND_FLAG.FIN : QUIC_SEND_FLAG.NONE); + await SendReadOnlySequenceAsync(buffers, endStream ? QUIC_SEND_FLAG.FIN : QUIC_SEND_FLAG.NONE).ConfigureAwait(false); HandleWriteCompletedState(); @@ -149,9 +149,9 @@ internal override async ValueTask WriteAsync(ReadOnlyMemory ThrowIfDisposed(); - using CancellationTokenRegistration registration = await HandleWriteStartState(cancellationToken); + using CancellationTokenRegistration registration = await HandleWriteStartState(cancellationToken).ConfigureAwait(false); - await SendReadOnlyMemoryListAsync(buffers, endStream ? QUIC_SEND_FLAG.FIN : QUIC_SEND_FLAG.NONE); + await SendReadOnlyMemoryListAsync(buffers, endStream ? QUIC_SEND_FLAG.FIN : QUIC_SEND_FLAG.NONE).ConfigureAwait(false); HandleWriteCompletedState(); @@ -164,9 +164,9 @@ internal override async ValueTask WriteAsync(ReadOnlyMemory buffer, bool e ThrowIfDisposed(); - using CancellationTokenRegistration registration = await HandleWriteStartState(cancellationToken); + using CancellationTokenRegistration registration = await HandleWriteStartState(cancellationToken).ConfigureAwait(false); - await SendReadOnlyMemoryAsync(buffer, endStream ? QUIC_SEND_FLAG.FIN : QUIC_SEND_FLAG.NONE); + await SendReadOnlyMemoryAsync(buffer, endStream ? QUIC_SEND_FLAG.FIN : QUIC_SEND_FLAG.NONE).ConfigureAwait(false); HandleWriteCompletedState(); @@ -209,7 +209,7 @@ private async ValueTask HandleWriteStartState(Can // Make sure start has completed if (!_started) { - await _sendResettableCompletionSource.GetTypelessValueTask(); + await _sendResettableCompletionSource.GetTypelessValueTask().ConfigureAwait(false); _started = true; } @@ -277,7 +277,7 @@ internal override async ValueTask ReadAsync(Memory destination, Cance // TODO there could potentially be a perf gain by storing the buffer from the inital read // This reduces the amount of async calls, however it makes it so MsQuic holds onto the buffers // longer than it needs to. We will need to benchmark this. - int length = (int)await _receiveResettableCompletionSource.GetValueTask(); + int length = (int)await _receiveResettableCompletionSource.GetValueTask().ConfigureAwait(false); int actual = Math.Min(length, destination.Length);