diff --git a/src/slic3r/Utils/Http.cpp b/src/slic3r/Utils/Http.cpp index 4f7a066194..a1c4f57c69 100644 --- a/src/slic3r/Utils/Http.cpp +++ b/src/slic3r/Utils/Http.cpp @@ -398,8 +398,8 @@ void Http::priv::http_perform(const HttpRetryOpt& retry_opts) if (res == CURLE_OK) ::curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_status); - retry = is_transient_error(res, http_status); - if (retry && num_retries >= retry_opts.max_retries) + retry = retry_opts.initial_delay > 0ms && is_transient_error(res, http_status); + if (retry && retry_opts.max_retries > 0 && num_retries >= retry_opts.max_retries) retry = false; if (retry) { num_retries++; diff --git a/src/slic3r/Utils/Http.hpp b/src/slic3r/Utils/Http.hpp index 6d21570c12..f190c40e1f 100644 --- a/src/slic3r/Utils/Http.hpp +++ b/src/slic3r/Utils/Http.hpp @@ -17,8 +17,10 @@ namespace Slic3r { struct HttpRetryOpt { + // if set to zero, no retries at all std::chrono::milliseconds initial_delay; std::chrono::milliseconds max_delay; + // if set to zero, retries forever size_t max_retries{0}; static const HttpRetryOpt& no_retry();