From d573b8df15780f6aa7473b053be5dd36587b8b66 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 24 Nov 2021 11:00:01 -0600 Subject: add option to disable distributed children --- src/slskd/Application.cs | 2 ++ src/slskd/Options.cs | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 49eed729..c4dfa46d 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -219,6 +219,7 @@ namespace slskd userEndPointCache: new UserEndPointCache(), distributedChildLimit: OptionsAtStartup.Soulseek.DistributedNetwork.ChildLimit, enableDistributedNetwork: !OptionsAtStartup.Soulseek.DistributedNetwork.Disabled, + acceptDistributedChildren: !OptionsAtStartup.Soulseek.DistributedNetwork.DisableChildren, autoAcknowledgePrivateMessages: false, acceptPrivateRoomInvitations: true, serverConnectionOptions: connectionOptions, @@ -638,6 +639,7 @@ namespace slskd listenPort: old.ListenPort == update.ListenPort ? null : update.ListenPort, enableDistributedNetwork: old.DistributedNetwork.Disabled == update.DistributedNetwork.Disabled ? null : !update.DistributedNetwork.Disabled, distributedChildLimit: old.DistributedNetwork.ChildLimit == update.DistributedNetwork.ChildLimit ? null : update.DistributedNetwork.ChildLimit, + acceptDistributedChildren: old.DistributedNetwork.DisableChildren == update.DistributedNetwork.DisableChildren ? null : !update.DistributedNetwork.DisableChildren, serverConnectionOptions: connectionPatch, peerConnectionOptions: connectionPatch, transferConnectionOptions: transferPatch, diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 914b0d88..66cb0e19 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -674,6 +674,14 @@ namespace slskd [Description("disable the distributed network")] public bool Disabled { get; private set; } = false; + /// + /// Gets a value indicating whether to accept distributed child connections. + /// + [Argument(default, "slsk-dnet-no-children")] + [EnvironmentVariable("SLSK_DNET_NO_CHILDREN")] + [Description("do not accept distributed children")] + public bool DisableChildren { get; private set; } = false; + /// /// Gets the distributed child connection limit. /// -- cgit v1.2.3