Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #460 from dannomac/master
Baptiste Daroussin committed 13 years ago
commit 83c618ff0c5cdc782f6634c119e85fe1c0912407
parent 1b99a73
3 files changed +12 -2
modified libpkg/fetch.c
@@ -119,6 +119,7 @@ pkg_fetch_file_to_fd(const char *url, int dest, time_t t)
	off_t r;

	int64_t max_retry, retry;
+
	int64_t fetch_timeout;
	time_t begin_dl;
	time_t now;
	time_t last = 0;
@@ -133,11 +134,14 @@ pkg_fetch_file_to_fd(const char *url, int dest, time_t t)
	struct http_mirror *http_current = NULL;
	const char *mt;

-
	fetchTimeout = 30;
-

	if (pkg_config_int64(PKG_CONFIG_FETCH_RETRY, &max_retry) == EPKG_FATAL)
		max_retry = 3;

+
	if (pkg_config_int64(PKG_CONFIG_FETCH_TIMEOUT, &fetch_timeout) == EPKG_FATAL)
+
		fetch_timeout = 30;
+

+
	fetchTimeout = (int) fetch_timeout;
+

	retry = max_retry;

	u = fetchParseURL(url);
modified libpkg/pkg.h.in
@@ -331,6 +331,7 @@ typedef enum _pkg_config_key {
	PKG_CONFIG_FTP_PROXY,
	PKG_CONFIG_NAMESERVER,
	PKG_CONFIG_EVENT_PIPE,
+
	PKG_CONFIG_FETCH_TIMEOUT,
} pkg_config_key;

typedef enum {
modified libpkg/pkg_config.c
@@ -225,6 +225,11 @@ static struct config_entry c[] = {
		PKG_CONFIG_STRING,
		"EVENT_PIPE",
		NULL,
+
	},
+
	[PKG_CONFIG_FETCH_TIMEOUT] = {
+
		PKG_CONFIG_INTEGER,
+
		"FETCH_TIMEOUT",
+
		"30",
	}
};