Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/hawkbit-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,16 @@ static gpointer download_thread(gpointer data)
resume_from, &sha1sum, &speed, &error))
break;

// resume download under certain conditions
for (const gint *code = &resumable_codes[0]; *code; code++)
resumable |= g_error_matches(error, RHU_HAWKBIT_CLIENT_CURL_ERROR, *code);

// but do not resume download on persistent HTTP server errors
if (error->domain == RHU_HAWKBIT_CLIENT_HTTP_ERROR &&
error->code >= 400 && error->code < 500 &&
error->code != 408 && error->code != 429)
resumable = FALSE;

if (!hawkbit_config->resume_downloads || !resumable) {
g_prefix_error(&error, "Download failed: ");
goto report_err;
Expand Down
Loading