aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs b/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
index 47d3eddb..dab099aa 100644
--- a/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
@@ -15,8 +15,8 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
public ISocket Socket { get; }
- private BsdContext _bsdContext;
- private SslVersion _sslVersion;
+ private readonly BsdContext _bsdContext;
+ private readonly SslVersion _sslVersion;
private SslStream _stream;
private bool _isBlockingSocket;
private int _previousReadTimeout;
@@ -67,25 +67,19 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
EndSslOperation();
}
-// NOTE: We silence warnings about TLS 1.0 and 1.1 as games will likely use it.
+ // NOTE: We silence warnings about TLS 1.0 and 1.1 as games will likely use it.
#pragma warning disable SYSLIB0039
- private static SslProtocols TranslateSslVersion(SslVersion version)
+ private SslProtocols TranslateSslVersion(SslVersion version)
{
- switch (version & SslVersion.VersionMask)
+ return (version & SslVersion.VersionMask) switch
{
- case SslVersion.Auto:
- return SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13;
- case SslVersion.TlsV10:
- return SslProtocols.Tls;
- case SslVersion.TlsV11:
- return SslProtocols.Tls11;
- case SslVersion.TlsV12:
- return SslProtocols.Tls12;
- case SslVersion.TlsV13:
- return SslProtocols.Tls13;
- default:
- throw new NotImplementedException(version.ToString());
- }
+ SslVersion.Auto => SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13,
+ SslVersion.TlsV10 => SslProtocols.Tls,
+ SslVersion.TlsV11 => SslProtocols.Tls11,
+ SslVersion.TlsV12 => SslProtocols.Tls12,
+ SslVersion.TlsV13 => SslProtocols.Tls13,
+ _ => throw new NotImplementedException(version.ToString()),
+ };
}
#pragma warning restore SYSLIB0039
@@ -114,7 +108,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
return 0;
}
- private static bool TryTranslateWinSockError(bool isBlocking, WsaError error, out ResultCode resultCode)
+ private bool TryTranslateWinSockError(bool isBlocking, WsaError error, out ResultCode resultCode)
{
switch (error)
{