From 91f3c7bd1b26b138328faafd95d7f449b02fdab9 Mon Sep 17 00:00:00 2001 From: Stone Li Date: Thu, 3 Aug 2023 15:27:38 +0800 Subject: [PATCH] ENH: close logging in console of libcurl Change-Id: I434f733a66ee79af762cfc2e52c28aba0e192d97 Signed-off-by: Stone Li (cherry picked from commit 2886ebbbedf60cd131cbd14594223ad5c5795b1d) --- src/slic3r/Utils/Http.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/slic3r/Utils/Http.cpp b/src/slic3r/Utils/Http.cpp index 7df1a81171..97279dddcf 100644 --- a/src/slic3r/Utils/Http.cpp +++ b/src/slic3r/Utils/Http.cpp @@ -143,6 +143,14 @@ struct Http::priv void http_perform(); }; +// add a dummy log callback +static int log_trace(CURL* handle, curl_infotype type, + char* data, size_t size, + void* userp) +{ + return 0; +} + Http::priv::priv(const std::string &url) : curl(::curl_easy_init()) , form(nullptr) @@ -161,6 +169,7 @@ Http::priv::priv(const std::string &url) set_timeout_connect(DEFAULT_TIMEOUT_CONNECT); set_timeout_max(DEFAULT_TIMEOUT_MAX); + ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, log_trace); ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // curl makes a copy internally ::curl_easy_setopt(curl, CURLOPT_USERAGENT, SLIC3R_APP_NAME "/" SLIC3R_VERSION); ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer.front());