mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-30 02:22:03 +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)
|
||||
::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++;
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user