From fe8e13341bdeae4a59c0270a632c29e71ae9deda Mon Sep 17 00:00:00 2001 From: Anatol Pomozov Date: Sun, 8 Mar 2020 13:33:32 -0700 Subject: Add config option to specify amount of parallel download streams It includes pacman.conf new 'ParallelDownloads' option that specifies how many concurrent downloads cURL starts in parallel. Add alpm_option_set_parallel_downloads() ALPM function that allows to set this config option programmatically. Signed-off-by: Anatol Pomozov Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c2a069ad..5d559db1 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -903,6 +903,15 @@ int alpm_option_set_remote_file_siglevel(alpm_handle_t *handle, int level); int alpm_option_set_disable_dl_timeout(alpm_handle_t *handle, unsigned short disable_dl_timeout); +/** Sets number of parallel streams to download database and package files. + * If the function is not called then the default value of '1' stream + * (i.e. sequential download) is used. + * @param handle the context handle + * @param num_streams number of parallel download streams + * @return 0 on success, -1 on error + */ +int alpm_option_set_parallel_downloads(alpm_handle_t *handle, unsigned int num_streams); + /** @} */ /** @addtogroup alpm_api_databases Database Functions -- cgit v1.2.3-54-g00ecf