X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcurl_uploader.cc;h=1fd8ced017f285504532432e99cb56108a21fcaf;hb=5f3a88d3ab1e9c1a13d7e61fc37a0c4cef8df9a5;hp=b05608536bccdeccb59c4926915961a2200af110;hpb=9081b07537c2eff413f383c4a3bf4de676a4b3c5;p=dcpomatic.git diff --git a/src/lib/curl_uploader.cc b/src/lib/curl_uploader.cc index b05608536..1fd8ced01 100644 --- a/src/lib/curl_uploader.cc +++ b/src/lib/curl_uploader.cc @@ -1,19 +1,20 @@ /* Copyright (C) 2015 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ @@ -22,6 +23,7 @@ #include "config.h" #include "cross.h" #include "compose.hpp" +#include #include "i18n.h" @@ -75,7 +77,8 @@ CurlUploader::upload_file (boost::filesystem::path from, boost::filesystem::path { curl_easy_setopt ( _curl, CURLOPT_URL, - String::compose ("ftp://%1/%2/%3", Config::instance()->tms_ip(), Config::instance()->tms_path(), to.string ()).c_str () + /* Use generic_string so that we get forward-slashes in the path, even on Windows */ + String::compose ("ftp://%1/%2/%3", Config::instance()->tms_ip(), Config::instance()->tms_path(), to.generic_string ()).c_str () ); _file = fopen_boost (from, "rb"); @@ -91,6 +94,7 @@ CurlUploader::upload_file (boost::filesystem::path from, boost::filesystem::path } fclose (_file); + _file = 0; } size_t