#include "curl_uploader.h"
+#include "dcpomatic_log.h"
#include "exceptions.h"
#include "config.h"
#include "cross.h"
}
+static int
+curl_debug_shim (CURL* curl, curl_infotype type, char* data, size_t size, void* userp)
+{
+ return reinterpret_cast<CurlUploader*>(userp)->debug(curl, type, data, size);
+}
+
+
CurlUploader::CurlUploader (function<void (string)> set_status, function<void (float)> set_progress)
: Uploader (set_status, set_progress)
{
if (!Config::instance()->tms_passive()) {
curl_easy_setopt(_curl, CURLOPT_FTPPORT, "-");
}
+ curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(_curl, CURLOPT_DEBUGFUNCTION, curl_debug_shim);
+ curl_easy_setopt(_curl, CURLOPT_DEBUGDATA, this);
}
return r;
}
+
+
+int
+CurlUploader::debug(CURL *, curl_infotype type, char* data, size_t size)
+{
+ if (type == CURLINFO_TEXT && size > 0) {
+ LOG_GENERAL("CurlUploader: %1", string(data, size - 1));
+ }
+ return 0;
+}
+