Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
curl: add support for HTTP_PROXY variable
Baptiste Daroussin committed 2 years ago
commit c0ec6eecfae1a00b6443cc0bbb3c9dd2cc6c3930
parent 67b61a8
1 file changed +4 -0
modified libpkg/fetch_libcurl.c
@@ -350,6 +350,7 @@ curl_fetch(struct pkg_repo *repo, int dest, struct fetch_item *fi)
	char *urlpath = NULL;
	const char *relpath = NULL;
	const char *userpasswd = get_http_auth();
+
	const char *http_proxy = getenv("HTTP_PROXY");

	struct curl_repodata *cr = (struct curl_repodata *)repo->fetch_priv;

@@ -430,6 +431,9 @@ retry:
		curl_easy_setopt(cl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
		curl_easy_setopt(cl, CURLOPT_USERPWD, userpasswd);
	}
+
	if (http_proxy != NULL) {
+
		curl_easy_setopt(cl, CURLOPT_PROXY, http_proxy);
+
	}

	if (repo->ip == IPV4)
		curl_easy_setopt(cl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);