From ca1a854fd1c4667c0b22b23192abf3e831d6d0c2 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sat, 13 Aug 2022 17:15:48 +0200 Subject: [PATCH] fix: use CURLOPT_POSTFIELDSIZE_LARGE to tell libcurl of the post content size --- winixd/utils/http.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/winixd/utils/http.cpp b/winixd/utils/http.cpp index 407fb7e..3faf641 100644 --- a/winixd/utils/http.cpp +++ b/winixd/utils/http.cpp @@ -477,12 +477,8 @@ bool Http::fetch_internal(const char * url, const std::string * in, pt::TextStre curl_easy_setopt(curl, CURLOPT_SEEKDATA, this); curl_easy_setopt(curl, CURLOPT_POST, 1); - /* - * do not set content-leght header here - * curl uses "Expect: 100-continue" and it collides if Content-Length is set - * https://daniel.haxx.se/blog/2020/02/27/expect-tweaks-in-curl/ - * - */ + curl_off_t size = read_function_input->size(); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, size); } curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fetch_write_function);