Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix librepo isn't able to load zchunk files from next server on failure #151

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions librepo/downloader.c
Expand Up @@ -2326,8 +2326,14 @@ check_transfer_statuses(LrDownload *dd, GError **err)
g_error_free(transfer_err); // Ignore the error

// Truncate file - remove downloaded garbage (error html page etc.)
if (!truncate_transfer_file(target, err))
return FALSE;
#ifdef WITH_ZCHUNK
if (!target->target->is_zchunk || target->zck_state == LR_ZCK_DL_HEADER) {
#endif
if (!truncate_transfer_file(target, err))
return FALSE;
#ifdef WITH_ZCHUNK
}
#endif
}
}

Expand Down