From 73e0d7dedc197f71c4fd6b7c18d2b2f2d63bf013 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Tue, 24 Nov 2020 12:39:08 +0000 Subject: libalpm: add alpm_option_get_parallel_downloads Signed-off-by: Allan McRae --- lib/libalpm/alpm.h | 2 ++ lib/libalpm/handle.c | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 6a7323e0..50c4bb6b 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -934,6 +934,8 @@ 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); +int alpm_option_get_parallel_downloads(alpm_handle_t *handle); + /** 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. diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 16d4beaa..3994f314 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -300,6 +300,16 @@ const char SYMEXPORT *alpm_option_get_dbext(alpm_handle_t *handle) return handle->dbext; } +int SYMEXPORT alpm_option_get_parallel_downloads(alpm_handle_t *handle) +{ + CHECK_HANDLE(handle, return -1); +#ifdef HAVE_LIBCURL + return handle->parallel_downloads; +#else + return 1; +#endif +} + int SYMEXPORT alpm_option_set_logcb(alpm_handle_t *handle, alpm_cb_log cb) { CHECK_HANDLE(handle, return -1); -- cgit v1.2.3-70-g09d2