New option in conffile to set libfetch's limit (seconds) in timed out connections.

This commit is contained in:
Juan RP
2011-06-22 09:53:44 +02:00
parent 6b4aaae971
commit fbfa9c5960
5 changed files with 28 additions and 2 deletions
+6 -1
View File
@@ -106,9 +106,14 @@ xbps_fetch_file(const char *uri,
assert(outputdir != NULL);
fetchLastErrCode = 0;
fetchTimeout = 30; /* 30 seconds of timeout */
xhp = xbps_handle_get();
if (xhp->fetch_timeout != 0)
fetchTimeout = xhp->fetch_timeout;
else
fetchTimeout = 30; /* 30s if not set in configuration file. */
/*
* Get the filename specified in URI argument.
*/
+4
View File
@@ -84,6 +84,8 @@ xbps_init(struct xbps_handle *xh)
"fetch-cache-connections", &fetch_cache_conn);
prop_dictionary_get_uint16(xhp->conf_dictionary,
"fetch-cache-connections-per-host", &fetch_cache_conn_host);
prop_dictionary_get_uint16(xhp->conf_dictionary,
"fetch-timeout-connection", &xhp->fetch_timeout);
}
/*
@@ -118,6 +120,8 @@ xbps_init(struct xbps_handle *xh)
__func__, xhp->rootdir, xhp->cachedir, xhp->conffile);
xbps_dbg_printf("%s: fetch_cache_conn: %zu fetch_cache_host: %zu\n",
__func__, fetch_cache_conn, fetch_cache_conn_host);
xbps_dbg_printf("%s: fetch_timeout: %zu\n", __func__,
xhp->fetch_timeout);
/*
* Initialize repository pool.