summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-02 00:32:13 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-09 00:35:10 +0200
commit82eea13a12df8f1160b2d92d6f1b4b25a3d63c23 (patch)
tree8c7ae25bee0f9cec3b39af842f8015c826df516b
parent86aece3fc0368fdbe58b3501c0abfb4b1d4c564b (diff)
Try to resume FTP uploads.
-rw-r--r--src/lib/curl_uploader.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/curl_uploader.cc b/src/lib/curl_uploader.cc
index 7b8cf44c8..888293073 100644
--- a/src/lib/curl_uploader.cc
+++ b/src/lib/curl_uploader.cc
@@ -97,6 +97,9 @@ CurlUploader::upload_file(boost::filesystem::path from, boost::filesystem::path
String::compose("ftp://%1/%2/%3", _destination.host, _destination.path, to.generic_string()).c_str()
);
+ curl_easy_setopt(_curl, CURLOPT_RESUME_FROM_LARGE, static_cast<curl_off_t>(-1));
+ curl_easy_setopt(_curl, CURLOPT_INFILESIZE_LARGE, boost::filesystem::file_size(from));
+
dcp::File file(from, "rb");
if (!file) {
throw NetworkError(String::compose(_("Could not open %1 to send"), from));