Add defs for default fetch cache connection limits and use them in

xbps_fetch_cache_connection() if 0 is passed as argument.

xbps-bin: enable fetch cached connection when downloading binpkgs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124153156-4updprik11nwi7c1
This commit is contained in:
Juan RP
2010-01-24 16:31:56 +01:00
parent 801785cbab
commit 088baa7699
3 changed files with 23 additions and 7 deletions

View File

@ -217,6 +217,20 @@ int xbps_cmpver(const char *pkg1, const char *pkg2);
/** @addtogroup download */
/*@{*/
/**
* @def XBPS_FETCH_CACHECONN
*
* Default (global) limit of cached connections used in libfetch.
*/
#define XBPS_FETCH_CACHECONN 8
/**
* @def XBPS_FETCH_CACHECONN_HOST
*
* Default (per host) limit of cached connections used in libfetch.
*/
#define XBPS_FETCH_CACHECONN_HOST 16
/**
* Download a file from a remote URL.
*
@ -237,8 +251,10 @@ int xbps_fetch_file(const char *uri,
/**
* Sets the libfetch's cache connection limits.
*
* @param[in] global Number of global cached connections, by default 8.
* @param[in] per_host Number of per host cached connections, by default 16.
* @param[in] global Number of global cached connections, if set to 0
* by default it's set to XBPS_FETCH_CACHECONN.
* @param[in] per_host Number of per host cached connections, if set to 0
* by default it's set to XBPS_FETCH_CACHECONN_HOST.
*/
void xbps_fetch_set_cache_connection(int global, int per_host);