aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Integrations
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-09-11 18:13:24 -0500
committerGitHub <noreply@github.com>2022-09-11 18:13:24 -0500
commite7b57da3dad5dacb6dbbc59c1464950eb170b0b4 (patch)
tree951f5f3531e3d69c99c9fd202d4467b4ff1d46ad /src/slskd/Integrations
parent3d657ed87cfdab4089c72d9e6532d9b2cc83aa4e (diff)
parenta596dfe252ef53e41b91ec6773aec93307c41f1e (diff)
downloadslskd-e7b57da3dad5dacb6dbbc59c1464950eb170b0b4.tar.gz
Merge pull request #641 from slskd/in-memory
Refactor share options, add option to allow users to select between on-disk and in-memory share caching
Diffstat (limited to 'src/slskd/Integrations')
-rw-r--r--src/slskd/Integrations/FTP/FTPClientFactory.cs16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/slskd/Integrations/FTP/FTPClientFactory.cs b/src/slskd/Integrations/FTP/FTPClientFactory.cs
index 2e41ab03..70cfbc03 100644
--- a/src/slskd/Integrations/FTP/FTPClientFactory.cs
+++ b/src/slskd/Integrations/FTP/FTPClientFactory.cs
@@ -47,24 +47,10 @@ namespace slskd.Integrations.FTP
public FtpClient CreateFtpClient()
{
var client = new FtpClient(FtpOptions.Address, FtpOptions.Port, FtpOptions.Username, FtpOptions.Password);
- client.EncryptionMode = ParseFtpEncryptionMode(FtpOptions.EncryptionMode);
+ client.EncryptionMode = FtpOptions.EncryptionMode.ToEnum<FtpEncryptionMode>();
client.ValidateAnyCertificate = FtpOptions.IgnoreCertificateErrors;
return client;
}
-
- private FtpEncryptionMode ParseFtpEncryptionMode(string encryptionMode)
- {
- try
- {
- return (FtpEncryptionMode)Enum.Parse(typeof(FtpEncryptionMode), encryptionMode, ignoreCase: true);
- }
- catch (Exception ex)
- {
- // Options should validate that the given string is parsable to FtpEncryptionMode through EnumAttribute; if this
- // throws there's a bug somewhere.
- throw new ArgumentException($"Failed to parse {typeof(FtpEncryptionMode).Name} from application Options. This is most likely a programming error; please file a GitHub issue and include your FTP configuration.", ex);
- }
- }
}
} \ No newline at end of file