rpm-software-management / librepo

A library providing C and Python (libcURL like) API for downloading packages and linux repository metadata in rpm-md format
http://rpm-software-management.github.io/librepo/
GNU Lesser General Public License v2.1
75 stars 91 forks source link

Make sure to check next transfer if current zck transfer already exists #153

Closed jdieter closed 5 years ago

jdieter commented 5 years ago

Currently, if prepare_next_transfer finds a complete zchunk file, it returns TRUE without moving on to the next file, which communicates to the thread that all downloads are done.

Luckily for us, there are normally other threads to finish downloading, but, if max_parallel_downloads is set to 1 in /etc/dnf/dnf.conf, this will have dnf fail to download the remaining metadata (whether zchunk or not) with the rather unhelpful error message: Not finished.

This patch fixes prepare_next_transfer to recursively check until it runs out of files to download or it finds an incomplete zchunk file.

This fixes RHBZ #1706627