diff options
author | Stephen Toub <stoub@microsoft.com> | 2022-02-15 23:33:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 23:33:41 +0300 |
commit | 10bf32207865dac20fdbce03af7e8891843d1c5e (patch) | |
tree | 547b57a94a373070465733ce4aabb74fe1038c6f /src/libraries/System.Net.Security/tests/UnitTests | |
parent | 99160fca9f5ddf3f2731c3de6afe276a378059c1 (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.cs | 11 |
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() { |