pacman/lib/libalpm
Anatol Pomozov f078c2d3bc Move signature payload creation to download engine
Until now callee of ALPM download functionality has been in charge of
payload creation both for the main file (e.g. *.pkg) and for the accompanied
*.sig file. One advantage of such solution is that all payloads are
independent and can be fetched in parallel thus exploiting the maximum
level of download parallelism.

To build *.sig file url we've been using a simple string concatenation:
$requested_url + ".sig". Unfortunately there are cases when it does not
work. For example an archlinux.org "Download From Mirror" link looks like
this https://www.archlinux.org/packages/core/x86_64/bash/download/ and
it gets redirected to some mirror. But if we append ".sig" to the end of
the link url and try to download it then archlinux.org returns 404 error.

To overcome this issue we need to follow redirects for the main payload
first, find the final url and only then append '.sig' suffix.
This implies 2 things:
 - the signature payload initialization need to be moved to dload.c
 as it is the place where we have access to the resolved url
 - *.sig is downloaded serially with the main payload and this reduces
 level of parallelism

Move *.sig payload creation to dload.c. Once the main payload is fetched
successfully we check if the callee asked to download the accompanied
signature. If yes - create a new payload and add it to mcurl.

*.sig payload does not use server list of the main payload and thus does
not support mirror failover. *.sig file comes from the same server as
the main payload.

Refactor event loop in curl_multi_download_internal() a bit. Instead of
relying on curl_multi_check_finished_download() to return number of new
payloads we simply rerun the loop iteration one more time to check if
there are any active downloads left.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-07-07 21:35:35 +10:00
..
po Final translation updates for pacman-5.2.0 2019-10-21 17:25:29 +10:00
.gitignore libalpm: add pkg-config file 2012-04-25 20:02:36 -04:00
add.c Remove unneeded goto cleanup 2020-03-09 14:51:38 +10:00
add.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
alpm.c Add multi_curl handle to ALPM global context 2020-05-09 11:58:21 +10:00
alpm.h Convert '-U pkg1 pkg2' codepath to parallel download 2020-06-26 15:59:08 +10:00
alpm_list.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
alpm_list.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
backup.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
backup.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
base64.c base64.c: comment out unused variable 2014-01-15 15:54:56 +10:00
base64.h Do not #define _RESERVED_IDENTIFIERS 2016-09-25 18:04:57 +10:00
be_local.c Use GOTO_ERR throughout 2020-04-13 23:44:46 +10:00
be_package.c Use GOTO_ERR throughout 2020-04-13 23:44:46 +10:00
be_sync.c Move signature payload creation to download engine 2020-07-07 21:35:35 +10:00
conflict.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
conflict.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
db.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
db.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
deps.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
deps.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
diskspace.c Constify some input pointers 2020-04-29 13:57:45 +10:00
diskspace.h Constify some input pointers 2020-04-29 13:57:45 +10:00
dload.c Move signature payload creation to download engine 2020-07-07 21:35:35 +10:00
dload.h Move signature payload creation to download engine 2020-07-07 21:35:35 +10:00
error.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
filelist.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
filelist.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
graph.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
graph.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
group.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
group.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
handle.c Add multi_curl handle to ALPM global context 2020-05-09 11:58:21 +10:00
handle.h Add multi_curl handle to ALPM global context 2020-05-09 11:58:21 +10:00
hook.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
hook.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
ini.c run hooks during trans_commit 2015-10-18 10:59:23 +10:00
ini.h run hooks during trans_commit 2015-10-18 10:59:23 +10:00
libalpm.pc.in build: add libintl dependency to meson and the .pc file 2020-06-11 10:47:14 +10:00
libarchive-compat.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
log.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
log.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
meson.build Remove support for deltas from libalpm 2019-03-07 11:12:12 +10:00
package.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
package.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
pkghash.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
pkghash.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
rawstr.c Remove all modelines from the project 2018-05-14 09:59:15 +10:00
remove.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
remove.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
signing.c libalpm/signing.c: Fix calculation of packet size in parse_subpacket 2020-06-01 10:59:08 +10:00
signing.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
sync.c Cleanup the old sequential download code 2020-06-26 15:59:16 +10:00
sync.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
trans.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
trans.h build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00
util-common.c Split common utility functions for libalpm and pacman 2013-01-04 21:49:37 +10:00
util-common.h Split common utility functions for libalpm and pacman 2013-01-04 21:49:37 +10:00
util.c Constify some input pointers 2020-04-29 13:57:45 +10:00
util.h Add REALLOC macro to simplify realloc error handling 2020-04-13 23:44:46 +10:00
version.c build-aux/update-copyright 2019 2020 2020-02-10 10:46:03 +10:00