From owner-svn-src-all@FreeBSD.ORG Thu Jul 1 17:44:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A0281065678; Thu, 1 Jul 2010 17:44:34 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38F288FC23; Thu, 1 Jul 2010 17:44:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o61HiYkA039345; Thu, 1 Jul 2010 17:44:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o61HiYS2039343; Thu, 1 Jul 2010 17:44:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201007011744.o61HiYS2039343@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 1 Jul 2010 17:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209632 - head/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2010 17:44:34 -0000 Author: des Date: Thu Jul 1 17:44:33 2010 New Revision: 209632 URL: http://svn.freebsd.org/changeset/base/209632 Log: 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 Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Jul 1 15:23:29 2010 (r209631) +++ head/lib/libfetch/http.c Thu Jul 1 17:44:33 2010 (r209632) @@ -1786,12 +1786,14 @@ http_request(struct url *URL, const char 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 */