summaryrefslogtreecommitdiff
path: root/src/lib/upload_destination.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-01 23:23:52 +0200
committerCarl Hetherington <cth@carlh.net>2025-06-03 22:46:26 +0200
commit9c9e2e1eba91d074d5477549a5230555c6edcedf (patch)
tree3398fb47ea8fd3db14f4f3647f53f73441193dd0 /src/lib/upload_destination.cc
parentcd2dffcd903a2a1d9f2b452bdd3cfec45cebe614 (diff)
Support specification of maximum simultaneous connections for upload.
Diffstat (limited to 'src/lib/upload_destination.cc')
-rw-r--r--src/lib/upload_destination.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/upload_destination.cc b/src/lib/upload_destination.cc
index fe5a94eeb..c91ba6a6f 100644
--- a/src/lib/upload_destination.cc
+++ b/src/lib/upload_destination.cc
@@ -21,12 +21,14 @@
#include "upload_destination.h"
#include <libcxml/cxml.h>
+#include <fmt/format.h>
UploadDestination::UploadDestination(cxml::ConstNodePtr node)
: name(node->string_child("Name"))
, protocol(file_transfer_protocol_from_string(node->string_child("Protocol")))
, passive_ftp(node->bool_child("PassiveFTP"))
+ , maximum_connections(node->optional_number_child<int>("MaximumConnections"))
, host(node->string_child("Host"))
, path(node->string_child("Path"))
, user(node->string_child("User"))
@@ -42,6 +44,9 @@ UploadDestination::as_xml(xmlpp::Element* parent) const
cxml::add_text_child(parent, "Name", name);
cxml::add_text_child(parent, "Protocol", file_transfer_protocol_to_string(protocol));
cxml::add_text_child(parent, "PassiveFTP", passive_ftp ? "1" : "0");
+ if (maximum_connections) {
+ cxml::add_text_child(parent, "MaximumConnections", fmt::to_string(*maximum_connections));
+ }
cxml::add_text_child(parent, "Host", host);
cxml::add_text_child(parent, "Path", path);
cxml::add_text_child(parent, "User", user);
@@ -55,6 +60,7 @@ operator==(UploadDestination const& a, UploadDestination const& b)
return a.name == b.name
&& a.protocol == b.protocol
&& a.passive_ftp == b.passive_ftp
+ && a.maximum_connections == b.maximum_connections
&& a.host == b.host
&& a.path == b.path
&& a.user == b.user