diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-12-18 11:03:07 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-12-18 11:03:07 +0000 |
commit | 62a2681c93b202959570b3ddecdbf40ced6bdebe (patch) | |
tree | f5124fad1675d5be07f4721b1851e7bf4d8359a5 /lib/libfetch/ftp.c | |
parent | 836e34eeae25a1ac5c6f284907308bb68fa8ba3d (diff) | |
download | src-62a2681c93b202959570b3ddecdbf40ced6bdebe.tar.gz src-62a2681c93b202959570b3ddecdbf40ced6bdebe.zip |
Notes
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r-- | lib/libfetch/ftp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index bac5c7246795..4316346ea228 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -1057,13 +1057,15 @@ ftp_cached_connect(struct url *url, struct url *purl, const char *flags) * Check the proxy settings */ static struct url * -ftp_get_proxy(const char *flags) +ftp_get_proxy(struct url * url, const char *flags) { struct url *purl; char *p; if (flags != NULL && strchr(flags, 'd') != NULL) return (NULL); + if (fetch_no_proxy_match(url->host)) + return (NULL); if (((p = getenv("FTP_PROXY")) || (p = getenv("ftp_proxy")) || (p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && *p && (purl = fetchParseURL(p)) != NULL) { @@ -1140,7 +1142,7 @@ ftp_request(struct url *url, const char *op, struct url_stat *us, FILE * fetchXGetFTP(struct url *url, struct url_stat *us, const char *flags) { - return (ftp_request(url, "RETR", us, ftp_get_proxy(flags), flags)); + return (ftp_request(url, "RETR", us, ftp_get_proxy(url, flags), flags)); } /* @@ -1158,9 +1160,8 @@ fetchGetFTP(struct url *url, const char *flags) FILE * fetchPutFTP(struct url *url, const char *flags) { - return (ftp_request(url, CHECK_FLAG('a') ? "APPE" : "STOR", NULL, - ftp_get_proxy(flags), flags)); + ftp_get_proxy(url, flags), flags)); } /* @@ -1171,9 +1172,10 @@ fetchStatFTP(struct url *url, struct url_stat *us, const char *flags) { FILE *f; - f = ftp_request(url, "STAT", us, ftp_get_proxy(flags), flags); + f = ftp_request(url, "STAT", us, ftp_get_proxy(url, flags), flags); if (f == NULL) return (-1); + fclose(f); return (0); } |