summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2010-07-01 17:44:33 +0000
committerdes <des@FreeBSD.org>2010-07-01 17:44:33 +0000
commit9c3639722d0a2ddfe00a5db8f27bbb2ba815e80a (patch)
tree3b3f6540d8667657fd98aca3e4dc57ccd8db89b1 /lib/libfetch
parent53dc0246397b6ba62579e7a22c054e8e67e44c0f (diff)
downloadFreeBSD-src-9c3639722d0a2ddfe00a5db8f27bbb2ba815e80a.zip
FreeBSD-src-9c3639722d0a2ddfe00a5db8f27bbb2ba815e80a.tar.gz
If the A flag is supplied, http_request() will attempt the request only
once, even if authentication is required, instead of retrying with the proper credentials. Fix this by bumping the countdown if the origin or proxy server requests authentication so that the initial unauthenticated request does not count as an attempt. PR: 148087 Submitted by: Tom Evans <tevans.uk@googlemail.com> MFC after: 2 weeks
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index f44366e..41c8100 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -1786,12 +1786,14 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
case hdr_www_authenticate:
if (conn->err != HTTP_NEED_AUTH)
break;
- http_parse_authenticate(p, &server_challenges);
+ if (http_parse_authenticate(p, &server_challenges))
+ ++n;
break;
case hdr_proxy_authenticate:
if (conn->err != HTTP_NEED_PROXY_AUTH)
break;
- http_parse_authenticate(p, &proxy_challenges);
+ if (http_parse_authenticate(p, &proxy_challenges) == 0);
+ ++n;
break;
case hdr_end:
/* fall through */
OpenPOWER on IntegriCloud