Sync shared code from runtime (#20126)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2020-03-25 11:52:16 +00:00 committed by GitHub
parent 9cc14dbb10
commit 76add623c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -89,7 +89,7 @@ namespace System.Net.Quic.Implementations.MsQuic
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);
}

View File

@ -80,7 +80,7 @@ namespace System.Net.Quic.Implementations.MsQuic
await connection.SetSecurityConfigForConnection(_sslOptions.ServerCertificate!,
_options.CertificateFilePath,
_options.PrivateKeyFilePath);
_options.PrivateKeyFilePath).ConfigureAwait(false);
if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
return connection;

View File

@ -129,9 +129,9 @@ namespace System.Net.Quic.Implementations.MsQuic
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 @@ namespace System.Net.Quic.Implementations.MsQuic
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 @@ namespace System.Net.Quic.Implementations.MsQuic
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 @@ namespace System.Net.Quic.Implementations.MsQuic
// Make sure start has completed
if (!_started)
{
await _sendResettableCompletionSource.GetTypelessValueTask();
await _sendResettableCompletionSource.GetTypelessValueTask().ConfigureAwait(false);
_started = true;
}
@ -277,7 +277,7 @@ namespace System.Net.Quic.Implementations.MsQuic
// 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);