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:
parent
9cc14dbb10
commit
76add623c9
|
|
@ -89,7 +89,7 @@ namespace System.Net.Quic.Implementations.MsQuic
|
||||||
|
|
||||||
internal async ValueTask SetSecurityConfigForConnection(X509Certificate cert, string? certFilePath, string? privateKeyFilePath)
|
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
|
// 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);
|
MsQuicParameterHelpers.SetSecurityConfig(MsQuicApi.Api, _ptr, (uint)QUIC_PARAM_LEVEL.CONNECTION, (uint)QUIC_PARAM_CONN.SEC_CONFIG, _securityConfig!.NativeObjPtr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ namespace System.Net.Quic.Implementations.MsQuic
|
||||||
|
|
||||||
await connection.SetSecurityConfigForConnection(_sslOptions.ServerCertificate!,
|
await connection.SetSecurityConfigForConnection(_sslOptions.ServerCertificate!,
|
||||||
_options.CertificateFilePath,
|
_options.CertificateFilePath,
|
||||||
_options.PrivateKeyFilePath);
|
_options.PrivateKeyFilePath).ConfigureAwait(false);
|
||||||
|
|
||||||
if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
|
if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
|
||||||
return connection;
|
return connection;
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,9 @@ namespace System.Net.Quic.Implementations.MsQuic
|
||||||
|
|
||||||
ThrowIfDisposed();
|
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();
|
HandleWriteCompletedState();
|
||||||
|
|
||||||
|
|
@ -149,9 +149,9 @@ namespace System.Net.Quic.Implementations.MsQuic
|
||||||
|
|
||||||
ThrowIfDisposed();
|
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();
|
HandleWriteCompletedState();
|
||||||
|
|
||||||
|
|
@ -164,9 +164,9 @@ namespace System.Net.Quic.Implementations.MsQuic
|
||||||
|
|
||||||
ThrowIfDisposed();
|
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();
|
HandleWriteCompletedState();
|
||||||
|
|
||||||
|
|
@ -209,7 +209,7 @@ namespace System.Net.Quic.Implementations.MsQuic
|
||||||
// Make sure start has completed
|
// Make sure start has completed
|
||||||
if (!_started)
|
if (!_started)
|
||||||
{
|
{
|
||||||
await _sendResettableCompletionSource.GetTypelessValueTask();
|
await _sendResettableCompletionSource.GetTypelessValueTask().ConfigureAwait(false);
|
||||||
_started = true;
|
_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
|
// 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
|
// 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.
|
// 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);
|
int actual = Math.Min(length, destination.Length);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue