Skip to content

Commit

Permalink
Fix PrusaLink upload when PUT is used (#5843)
Browse files Browse the repository at this point in the history
(#5840) Fix PrusaLink upload when PUT is used
  • Loading branch information
Noisyfox authored Jun 24, 2024
1 parent 34ad17b commit 76fc7e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/slic3r/Utils/Http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct Http::priv
std::string headers;
size_t limit;
bool cancel;
std::unique_ptr<fs::ifstream> putFile;
std::unique_ptr<form_file> putFile;

std::thread io_thread;
Http::CompleteFn completefn;
Expand Down Expand Up @@ -381,7 +381,7 @@ void Http::priv::set_put_body(const fs::path &path)
boost::system::error_code ec;
boost::uintmax_t filesize = file_size(path, ec);
if (!ec) {
putFile = std::make_unique<fs::ifstream>(path, std::ios_base::binary |std::ios_base::in);
putFile = std::make_unique<form_file>(form_file{{path, std::ios_base::binary | std::ios_base::in}, 0, 0});
::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
::curl_easy_setopt(curl, CURLOPT_READDATA, (void *) (putFile.get()));
::curl_easy_setopt(curl, CURLOPT_INFILESIZE, filesize);
Expand Down

0 comments on commit 76fc7e6

Please sign in to comment.