From owner-svn-src-all@freebsd.org Tue May 31 08:27:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C11F3B5594E; Tue, 31 May 2016 08:27:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 810631F0D; Tue, 31 May 2016 08:27:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V8RdQ9015084; Tue, 31 May 2016 08:27:39 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V8RdC8015083; Tue, 31 May 2016 08:27:39 GMT (envelope-from des@FreeBSD.org) Message-Id: <201605310827.u4V8RdC8015083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 31 May 2016 08:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301027 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 31 May 2016 08:27:40 -0000 Author: des Date: Tue May 31 08:27:39 2016 New Revision: 301027 URL: https://svnweb.freebsd.org/changeset/base/301027 Log: r169386 (PR 112515) was incomplete: it treated 307 as an error except in verbose mode, and did not handle 308 at all. r241840 (PR 172451) added support for 308, but with the same bug. Correctly handle both by recognizing them as redirects in all places where we check the HTTP result code. PR: 112515 173451 209546 Submitted by: novel@ MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Tue May 31 08:07:40 2016 (r301026) +++ head/lib/libfetch/http.c Tue May 31 08:27:39 2016 (r301027) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ || (xyz) == HTTP_MOVED_TEMP \ || (xyz) == HTTP_TEMP_REDIRECT \ + || (xyz) == HTTP_PERM_REDIRECT \ || (xyz) == HTTP_USE_PROXY \ || (xyz) == HTTP_SEE_OTHER) @@ -1767,6 +1768,8 @@ http_request_body(struct url *URL, const break; case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: + case HTTP_TEMP_REDIRECT: + case HTTP_PERM_REDIRECT: case HTTP_SEE_OTHER: case HTTP_USE_PROXY: /*