diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2003-03-11 08:20:58 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2003-03-11 08:20:58 +0000 |
commit | b91d6074d447f2436e03f3930fa5e882a7240249 (patch) | |
tree | 8aa030b87e93c4ace4debb91dc4978fa0fed48c8 /lib/libfetch/http.c | |
parent | 9ec559555bd0a743cc932c549869bcc7910b72b7 (diff) | |
download | src-b91d6074d447f2436e03f3930fa5e882a7240249.tar.gz src-b91d6074d447f2436e03f3930fa5e882a7240249.zip |
Don't parse the proxy URL unless we're actually going to use it. No real
functional difference, but debugging output will be less confusing.
Notes
Notes:
svn path=/head/; revision=112081
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r-- | lib/libfetch/http.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 5f44c5358359..1fc4cd5932c0 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -696,11 +696,13 @@ _http_connect(struct url *URL, struct url *purl, const char *flags) } static struct url * -_http_get_proxy(void) +_http_get_proxy(const char *flags) { struct url *purl; char *p; + if (strchr(flags, 'd') != NULL) + return (NULL); if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && (purl = fetchParseURL(p))) { if (!*purl->scheme) @@ -1108,7 +1110,7 @@ ouch: FILE * fetchXGetHTTP(struct url *URL, struct url_stat *us, const char *flags) { - return (_http_request(URL, "GET", us, _http_get_proxy(), flags)); + return (_http_request(URL, "GET", us, _http_get_proxy(flags), flags)); } /* @@ -1138,7 +1140,8 @@ fetchStatHTTP(struct url *URL, struct url_stat *us, const char *flags) { FILE *f; - if ((f = _http_request(URL, "HEAD", us, _http_get_proxy(), flags)) == NULL) + f = _http_request(URL, "HEAD", us, _http_get_proxy(flags), flags); + if (f == NULL) return (-1); fclose(f); return (0); |