Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2022-02-15 23:33:41 +0300
committerGitHub <noreply@github.com>2022-02-15 23:33:41 +0300
commit10bf32207865dac20fdbce03af7e8891843d1c5e (patch)
tree547b57a94a373070465733ce4aabb74fe1038c6f /src/libraries/System.Net.Security/tests/UnitTests
parent99160fca9f5ddf3f2731c3de6afe276a378059c1 (diff)
Change SslStream's internal adapter interface to use static abstract interface methods (#65239)
* Use static abstract interface methods in Ssl/NegotiateStream adapters * Remove unnecessary argument from a bunch of methods It's only used to add duplicative information to an exception message, and in doing so it makes the async methods it's used in more expensive.
Diffstat (limited to 'src/libraries/System.Net.Security/tests/UnitTests')
-rw-r--r--src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs b/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs
index 9298542f607..140792db4ec 100644
--- a/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs
+++ b/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs
@@ -37,10 +37,11 @@ namespace System.Net.Security
_sslAuthenticationOptions = new FakeOptions() { TargetHost = sslAuthenticationOptions.TargetHost };
}
- private ValueTask WriteAsyncInternal<TWriteAdapter>(TWriteAdapter writeAdapter, ReadOnlyMemory<byte> buffer)
- where TWriteAdapter : struct, IReadWriteAdapter => default;
+ private ValueTask WriteAsyncInternal<TWriteAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
+ where TWriteAdapter : IReadWriteAdapter => default;
- private ValueTask<int> ReadAsyncInternal<TReadAdapter>(TReadAdapter adapter, Memory<byte> buffer) => default;
+ private ValueTask<int> ReadAsyncInternal<TReadAdapter>(Memory<byte> buffer, CancellationToken cancellationToken)
+ where TReadAdapter : IReadWriteAdapter => default;
private bool RemoteCertRequired => default;
@@ -51,12 +52,12 @@ namespace System.Net.Security
// This method assumes that a SSPI context is already in a good shape.
// For example it is either a fresh context or already authenticated context that needs renegotiation.
//
- private Task ProcessAuthenticationAsync(bool isAsync = false, bool isApm = false, CancellationToken cancellationToken = default)
+ private Task ProcessAuthenticationAsync(bool isAsync = false, CancellationToken cancellationToken = default)
{
return Task.Run(() => { });
}
- private Task RenegotiateAsync(AsyncReadWriteAdapter adapter) => throw new PlatformNotSupportedException();
+ private Task RenegotiateAsync<AsyncReadWriteAdapter>(CancellationToken cancellationToken) => throw new PlatformNotSupportedException();
private void ReturnReadBufferIfEmpty()
{