summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2001-03-07 04:45:55 +0000
committerdes <des@FreeBSD.org>2001-03-07 04:45:55 +0000
commit1804e2a81815566b69c6a54aff89eaf4a57c8e65 (patch)
treef8c637bb9a7cdda4f389a9f7202ee2a6629e0622
parent9c1fb038d7d49d0f13914c9cf74abbaf2252f87c (diff)
downloadFreeBSD-src-1804e2a81815566b69c6a54aff89eaf4a57c8e65.zip
FreeBSD-src-1804e2a81815566b69c6a54aff89eaf4a57c8e65.tar.gz
Support lower-case versions of the proxy environment variables.
PR: bin/25494
-rw-r--r--lib/libfetch/fetch.38
-rw-r--r--lib/libfetch/ftp.c5
-rw-r--r--lib/libfetch/http.c3
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index b0c3b14..55ddd6e 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -449,6 +449,10 @@ If this variable is set to an empty string, no proxy will be used for
FTP requests, even if the
.Ev HTTP_PROXY
variable is set.
+.It Ev ftp_proxy
+Same as
+.Ev FTP_PROXY ,
+for compatibility.
.It Ev HTTP_AUTH
Specifies HTTP authorization parameters as a colon-separated list of
items.
@@ -470,6 +474,10 @@ If no port number is specified, the default is 3128.
Note that this proxy will also be used for FTP documents, unless the
.Ev FTP_PROXY
variable is set.
+.It Ev http_proxy
+Same as
+.Ev HTTP_PROXY ,
+for compatibility.
.It Ev HTTP_PROXY_AUTH
Specifies authorization parameters for the HTTP proxy in the same
format as the
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 0be1d0d..713a856 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -875,10 +875,11 @@ _ftp_get_proxy(void)
struct url *purl;
char *p;
- if (((p = getenv("FTP_PROXY")) || (p = getenv("HTTP_PROXY"))) &&
+ if (((p = getenv("FTP_PROXY")) || (p = getenv("ftp_proxy")) ||
+ (p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) &&
*p && (purl = fetchParseURL(p)) != NULL) {
if (!*purl->scheme) {
- if (getenv("FTP_PROXY"))
+ if (getenv("FTP_PROXY") || getenv("ftp_proxy"))
strcpy(purl->scheme, SCHEME_FTP);
else
strcpy(purl->scheme, SCHEME_HTTP);
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 9c4bebb..5c22097 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -651,7 +651,8 @@ _http_get_proxy()
struct url *purl;
char *p;
- if ((p = getenv("HTTP_PROXY")) && (purl = fetchParseURL(p))) {
+ if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) &&
+ (purl = fetchParseURL(p))) {
if (!*purl->scheme)
strcpy(purl->scheme, SCHEME_HTTP);
if (!purl->port)
OpenPOWER on IntegriCloud