aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-11-26 23:11:05 -0600
committerGitHub <noreply@github.com>2021-11-26 23:11:05 -0600
commit36e0fc96988d2e37fd7e6b2041c8669cac360496 (patch)
treeadcd0967dbe8383de72c25aef8866214f145ac4d
parentf792beb409b4fa8ee1cc8cd74bc314f2556df93d (diff)
parent78c81b7f5d873a917ccbce5e01a87f40dd5426ae (diff)
downloadslskd-36e0fc96988d2e37fd7e6b2041c8669cac360496.tar.gz
Merge pull request #283 from slskd/config-bug
Fix bug causing failed option update
-rw-r--r--src/slskd/Application.cs8
-rw-r--r--src/slskd/Common/Configuration/YamlConfigurationSource.cs5
2 files changed, 3 insertions, 10 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 3914483e..d0cbe361 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -633,9 +633,9 @@ namespace slskd
var configureKeepAlive = new Action<Socket>(socket =>
{
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
- socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.TcpKeepAliveTime, connection.Timeout.Inactivity / 1000);
- socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.TcpKeepAliveInterval, connection.Timeout.Inactivity / 1000);
- socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.TcpKeepAliveRetryCount, 3);
+ socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, connection.Timeout.Inactivity / 1000);
+ socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, connection.Timeout.Inactivity / 1000);
+ socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 3);
});
serverPatch = connectionPatch.With(configureSocketAction: configureKeepAlive);
@@ -657,8 +657,6 @@ namespace slskd
incomingConnectionOptions: connectionPatch,
distributedConnectionOptions: distributedPatch);
- Logger.Debug("Patching Soulseek options with {Patch}", patch.ToJson());
-
soulseekRequiresReconnect = await Client.ReconfigureOptionsAsync(patch);
}
diff --git a/src/slskd/Common/Configuration/YamlConfigurationSource.cs b/src/slskd/Common/Configuration/YamlConfigurationSource.cs
index 82e2227d..cd388f46 100644
--- a/src/slskd/Common/Configuration/YamlConfigurationSource.cs
+++ b/src/slskd/Common/Configuration/YamlConfigurationSource.cs
@@ -132,11 +132,6 @@ namespace slskd.Configuration
if (root is YamlScalarNode scalar)
{
- if (Data.ContainsKey(Normalize(path)))
- {
- throw new FormatException($"A duplicate key '{Normalize(path)}' was found.");
- }
-
var value = NullValues.Contains(scalar.Value.ToLower()) ? null : scalar.Value;
if (value != null)