mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-30 16:41:58 +08:00
Http: fixed condition for retry (if retry enabled)
This commit is contained in:
parent
5b79c8b50a
commit
3b8d34ec5f
@ -398,8 +398,8 @@ void Http::priv::http_perform(const HttpRetryOpt& retry_opts)
|
|||||||
|
|
||||||
if (res == CURLE_OK)
|
if (res == CURLE_OK)
|
||||||
::curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_status);
|
::curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_status);
|
||||||
retry = is_transient_error(res, http_status);
|
retry = retry_opts.initial_delay > 0ms && is_transient_error(res, http_status);
|
||||||
if (retry && num_retries >= retry_opts.max_retries)
|
if (retry && retry_opts.max_retries > 0 && num_retries >= retry_opts.max_retries)
|
||||||
retry = false;
|
retry = false;
|
||||||
if (retry) {
|
if (retry) {
|
||||||
num_retries++;
|
num_retries++;
|
||||||
|
@ -17,8 +17,10 @@ namespace Slic3r {
|
|||||||
|
|
||||||
struct HttpRetryOpt
|
struct HttpRetryOpt
|
||||||
{
|
{
|
||||||
|
// if set to zero, no retries at all
|
||||||
std::chrono::milliseconds initial_delay;
|
std::chrono::milliseconds initial_delay;
|
||||||
std::chrono::milliseconds max_delay;
|
std::chrono::milliseconds max_delay;
|
||||||
|
// if set to zero, retries forever
|
||||||
size_t max_retries{0};
|
size_t max_retries{0};
|
||||||
|
|
||||||
static const HttpRetryOpt& no_retry();
|
static const HttpRetryOpt& no_retry();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user