Add network.scgi.open_systemd command unconditionally

This commit is contained in:
zqmfb
2026-03-25 18:30:38 -04:00
committed by Jari Sundell
parent 71bb51c3fd
commit 8d50aee96f
+4 -4
View File
@@ -147,9 +147,9 @@ apply_scgi(const std::string& arg, int type) {
return torrent::Object();
}
#ifdef HAVE_SYSTEMD
torrent::Object
apply_scgi_systemd() {
#ifdef HAVE_SYSTEMD
if (scgi_thread::scgi() != nullptr)
throw torrent::input_error("SCGI already enabled.");
@@ -182,8 +182,10 @@ apply_scgi_systemd() {
scgi_thread::set_scgi(scgi);
return torrent::Object();
}
#else
throw torrent::input_error("rtorrent was not built with systemd support.");
#endif
}
torrent::Object
apply_xmlrpc_dialect(const std::string& arg) {
@@ -285,9 +287,7 @@ initialize_command_network() {
CMD2_ANY_STRING ("network.scgi.open_port", std::bind(&apply_scgi, std::placeholders::_2, 1));
CMD2_ANY_STRING ("network.scgi.open_local", std::bind(&apply_scgi, std::placeholders::_2, 2));
CMD2_VAR_BOOL ("network.scgi.dont_route", false);
#ifdef HAVE_SYSTEMD
CMD2_ANY_VALUE_V ("network.scgi.open_systemd", [](auto, auto& value) { if (value != 0) apply_scgi_systemd(); });
#endif
CMD2_ANY_STRING ("network.xmlrpc.dialect.set", [](const auto&, const auto& arg) { return apply_xmlrpc_dialect(arg); })
CMD2_ANY ("network.xmlrpc.size_limit", [](const auto&, const auto&) { return rpc::rpc.size_limit(); });