mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
ENH: close logging in console of libcurl
Change-Id: I434f733a66ee79af762cfc2e52c28aba0e192d97 Signed-off-by: Stone Li <stone.li@bambulab.com> (cherry picked from commit 2886ebbbedf60cd131cbd14594223ad5c5795b1d)
This commit is contained in:
parent
2f09e25e95
commit
91f3c7bd1b
1 changed files with 9 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue