libalpm: add alpm_option_get_parallel_downloads

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
morganamilo 2020-11-24 12:39:08 +00:00 committed by Allan McRae
parent 66f9f315cf
commit 73e0d7dedc
2 changed files with 12 additions and 0 deletions

View file

@ -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.

View file

@ -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);