Skip to content

Commit d01051c

Browse files
committed
deal with TFM-specific warnings from .NET 10
1 parent c54d94d commit d01051c

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/StackExchange.Redis/ConfigurationOptions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ internal static LocalCertificateSelectionCallback CreatePemUserCertificateCallba
340340

341341
internal static LocalCertificateSelectionCallback CreatePfxUserCertificateCallback(string userCertificatePath, string? password, X509KeyStorageFlags storageFlags = X509KeyStorageFlags.DefaultKeySet)
342342
{
343+
#pragma warning disable SYSLIB0057
343344
var pfx = new X509Certificate2(userCertificatePath, password ?? "", storageFlags);
345+
#pragma warning restore SYSLIB0057
344346
return (sender, targetHost, localCertificates, remoteCertificate, acceptableIssuers) => pfx;
345347
}
346348

@@ -351,7 +353,9 @@ internal static LocalCertificateSelectionCallback CreatePfxUserCertificateCallba
351353
public void TrustIssuer(X509Certificate2 issuer) => CertificateValidationCallback = TrustIssuerCallback(issuer);
352354

353355
internal static RemoteCertificateValidationCallback TrustIssuerCallback(string issuerCertificatePath)
356+
#pragma warning disable SYSLIB0057
354357
=> TrustIssuerCallback(new X509Certificate2(issuerCertificatePath));
358+
#pragma warning restore SYSLIB0057
355359
private static RemoteCertificateValidationCallback TrustIssuerCallback(X509Certificate2 issuer)
356360
{
357361
if (issuer == null) throw new ArgumentNullException(nameof(issuer));

src/StackExchange.Redis/ExceptionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ internal static Exception NoConnectionAvailable(
107107
serverSnapshot = new ServerEndPoint[] { server };
108108
}
109109

110-
var innerException = PopulateInnerExceptions(serverSnapshot == default ? multiplexer.GetServerSnapshot() : serverSnapshot);
110+
var innerException = PopulateInnerExceptions(serverSnapshot.IsEmpty ? multiplexer.GetServerSnapshot() : serverSnapshot);
111111

112112
// Try to get a useful error message for the user.
113113
long attempts = multiplexer._connectAttemptCount, completions = multiplexer._connectCompletedCount;

src/StackExchange.Redis/PhysicalConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ internal void WriteHeader(RedisCommand command, int arguments, CommandBytes comm
913913
internal void RecordQuit()
914914
{
915915
// don't blame redis if we fired the first shot
916-
Thread.VolatileWrite(ref clientSentQuit, 1);
916+
Volatile.Write(ref clientSentQuit, 1);
917917
(_ioPipe as SocketConnection)?.TrySetProtocolShutdown(PipeShutdownKind.ProtocolExitClient);
918918
}
919919

0 commit comments

Comments
 (0)