1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Fix old-style proxy specs: default to FTP if FTP_PROXY was set; only default

to HTTP if HTTP_PROXY was used instead.
This commit is contained in:
Dag-Erling Smørgrav 2000-11-27 13:42:56 +00:00
parent b431558526
commit 882974d431
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69272

View File

@ -876,8 +876,12 @@ _ftp_get_proxy(void)
if (((p = getenv("FTP_PROXY")) || (p = getenv("HTTP_PROXY"))) &&
*p && (purl = fetchParseURL(p)) != NULL) {
if (!*purl->scheme)
strcpy(purl->scheme, SCHEME_HTTP);
if (!*purl->scheme) {
if (getenv("FTP_PROXY"))
strcpy(purl->scheme, SCHEME_FTP);
else
strcpy(purl->scheme, SCHEME_HTTP);
}
if (!purl->port)
purl->port = _fetch_default_proxy_port(purl->scheme);
if (strcasecmp(purl->scheme, SCHEME_FTP) == 0 ||