aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-01-06 17:19:31 -0600
committerJP Dillingham <jp@dillingham.me>2024-01-06 17:19:31 -0600
commit9659015d025fb0d4276106e8bcc8333942c094fd (patch)
treed96a4d9c55d00b3902fe3a13c3933992ee103e6e /src
parent8538d22cd30ff51f7641fc07b3793534874fa18f (diff)
downloadslskd-9659015d025fb0d4276106e8bcc8333942c094fd.tar.gz
resolve more warnings
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Options.cs2
-rw-r--r--src/slskd/Relay/RelayClient.cs4
-rw-r--r--src/slskd/Relay/RelayService.cs2
-rw-r--r--src/slskd/Shares/Types/Share.cs2
-rw-r--r--src/slskd/Users/UserService.cs2
-rw-r--r--src/slskd/slskd.csproj4
6 files changed, 12 insertions, 4 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index a3437bf4..e34a86b0 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -682,7 +682,9 @@ namespace slskd
return (share, matches[0].Groups[2].Value, matches[0].Groups[3].Value);
}
+#pragma warning disable S3878 // Arrays should not be created for params parameters
return (share, share.Split(new[] { '/', '\\' }).Last(), share);
+#pragma warning restore S3878 // Arrays should not be created for params parameters
}
var digestedShared = directories
diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs
index f3880c97..b54a04f3 100644
--- a/src/slskd/Relay/RelayClient.cs
+++ b/src/slskd/Relay/RelayClient.cs
@@ -259,7 +259,9 @@ namespace slskd.Relay
{
if (message is HttpClientHandler clientHandler && options.Relay.Controller.IgnoreCertificateErrors)
{
+#pragma warning disable S4830 // Enable server certificate validation on this SSL/TLS connection
clientHandler.ServerCertificateCustomValidationCallback += (_, _, _, _) => true;
+#pragma warning restore S4830 // Enable server certificate validation on this SSL/TLS connection
}
return message;
@@ -304,7 +306,9 @@ namespace slskd.Relay
client = new HttpClient(new HttpClientHandler()
{
ClientCertificateOptions = ClientCertificateOption.Manual,
+#pragma warning disable S4830 // Enable server certificate validation on this SSL/TLS connection
ServerCertificateCustomValidationCallback = (_, _, _, _) => true,
+#pragma warning restore S4830 // Enable server certificate validation on this SSL/TLS connection
});
}
else
diff --git a/src/slskd/Relay/RelayService.cs b/src/slskd/Relay/RelayService.cs
index 6cbbb0a2..d3f35693 100644
--- a/src/slskd/Relay/RelayService.cs
+++ b/src/slskd/Relay/RelayService.cs
@@ -624,7 +624,7 @@ namespace slskd.Relay
// ensure filename is relative to the local download directory and make sure it doesn't start with a slash
filename = filename
.ReplaceFirst(OptionsMonitor.CurrentValue.Directories.Downloads, string.Empty)
- .TrimStart(new[] { '/', '\\' });
+ .TrimStart('/', '\\');
async Task Notify((string ConnectionId, Agent Agent) record)
{
diff --git a/src/slskd/Shares/Types/Share.cs b/src/slskd/Shares/Types/Share.cs
index d60998f6..2911cf83 100644
--- a/src/slskd/Shares/Types/Share.cs
+++ b/src/slskd/Shares/Types/Share.cs
@@ -76,7 +76,9 @@ namespace slskd.Shares
}
else
{
+#pragma warning disable S3878 // Arrays should not be created for params parameters
Alias = share.Split(new[] { '/', '\\' }).Last();
+#pragma warning restore S3878 // Arrays should not be created for params parameters
LocalPath = share;
}
diff --git a/src/slskd/Users/UserService.cs b/src/slskd/Users/UserService.cs
index 434d357c..5b15b671 100644
--- a/src/slskd/Users/UserService.cs
+++ b/src/slskd/Users/UserService.cs
@@ -49,7 +49,7 @@ namespace slskd.Users
/// The data in the <see cref="UserDictionary"/> can continue to grow until -- unlikely -- it contains a record for every
/// user on or that was on the network at any point since the last client connect. This is a calculated risk, roughly
/// knowing the size of the network, the size of the data being stored, and balanced against the consequences of not having
- /// a user's data when it is needed (for queue positioning, speed limits, etc)
+ /// a user's data when it is needed (for queue positioning, speed limits, etc).
/// </para>
/// <para>
/// The <see cref="GetGroup(string)"/> method acts on cached data _only_. This method should be called within hot paths,
diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj
index 82108d47..9ca072a0 100644
--- a/src/slskd/slskd.csproj
+++ b/src/slskd/slskd.csproj
@@ -17,11 +17,11 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
- <NoWarn>1701;1702;1591</NoWarn>
+ <NoWarn>1701;1702;1591;S1133;S2094;S1135</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
- <NoWarn>1591</NoWarn>
+ <NoWarn>1591;S1133;S2094;S1135</NoWarn>
</PropertyGroup>
<ItemGroup>