diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2000-12-01 10:47:57 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2000-12-01 10:47:57 +0000 |
| commit | a8d732a66e78fdc4e3d03f2091847e3cf8b31713 (patch) | |
| tree | e376c78aae2b03cde8d4c007eab04a14b3a68a2d /lib/libfetch | |
| parent | 4ebc2be5dbb0411870cfc87b88b6b996bcac2189 (diff) | |
Notes
Diffstat (limited to 'lib/libfetch')
| -rw-r--r-- | lib/libfetch/common.c | 4 | ||||
| -rw-r--r-- | lib/libfetch/ftp.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 4d05a6b6dcd9..459154f3af1d 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -190,10 +190,6 @@ _fetch_default_port(char *scheme) int _fetch_default_proxy_port(char *scheme) { - struct servent *se; - - if ((se = getservbyname(scheme, "tcp")) != NULL) - return ntohs(se->s_port); if (strcasecmp(scheme, SCHEME_FTP) == 0) return FTP_DEFAULT_PROXY_PORT; if (strcasecmp(scheme, SCHEME_HTTP) == 0) diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index ab2c54d503d6..d9f624ef4852 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -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 || |
