From 962cf295258b751f3922e6ca7c998e0c4e784254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 1 Jul 2010 17:44:33 +0000 Subject: [PATCH] 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 MFC after: 2 weeks --- lib/libfetch/http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index f44366e6ff2..41c81007a8f 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 */