On 14/4/20 4:33 am, Anatol Pomozov wrote:
Hi
On Thu, Mar 12, 2020 at 6:16 PM Allan McRae <allan@archlinux.org> wrote:
On 9/3/20 6:59 am, Anatol Pomozov wrote:
This is an equivalent of alpm_db_update but for multiplexed (parallel) download. The difference is that this function accepts list of databases to update. And then ALPM internals download it in parallel if possible.
Add a stub for _alpm_multi_download the function that will do parallel payloads downloads in the future.
Introduce dload_payload->filepath field that contains url path to the file we download. It is like fileurl field but does not contain protocol/server part. The rationale for having this field is that with the curl multidownload the server retry logic is going to move to a curl callback. And the callback needs to be able to reconstruct the 'next' fileurl. One will be able to do it by getting the next server url from 'servers' list and then concat with filepath. Once the 'parallel download' refactoring is over 'fileurl' field will go away.
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
<snip>
+ sig_payload->handle = handle; + sig_payload->force = dbforce;
Always "force" the signature. sig_payload->force = 1;
I sent a change with "->force = 1;" and it got applied to Allan's patchqueu. But I would like to review this line one more time and switch it back to "sig_payload->force = dbforce;"
Having "sig_payload->force = 1;" forces ALPM to ignore modification time and always download the file. It was fine before when *.sig file downloaded only after we found that *.db file is changed (in this case *.sig is changed as well). With the new logic we start downloading the files in parallel. *.db file content is download only if modification time is newer. But setting "sig_payload->force = 1;" forced downloading *.sig file content every time. And most of the time it is unneeded. We need to download the *.sig file content only when it changed.
Thus I propose to make this line to "sig_payload->force = dbforce;" (i.e. force download signature only when we force download the *.db file).
This is good reasoning. I'll edit that back into the patch on my patchqueue branch. A