From owner-svn-src-all@FreeBSD.ORG Mon Oct 22 03:00:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A114F2C; Mon, 22 Oct 2012 03:00:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0197F8FC08; Mon, 22 Oct 2012 03:00:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9M30FDX016201; Mon, 22 Oct 2012 03:00:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9M30FlX016199; Mon, 22 Oct 2012 03:00:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210220300.q9M30FlX016199@svn.freebsd.org> From: Eitan Adler Date: Mon, 22 Oct 2012 03:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241841 - 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.14 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: Mon, 22 Oct 2012 03:00:16 -0000 Author: eadler Date: Mon Oct 22 03:00:15 2012 New Revision: 241841 URL: http://svn.freebsd.org/changeset/base/241841 Log: Implement HTTP 305 redirect handling. PR: 172452 Submitted by: gcooper Reviewed by: des Approved by: cperciva MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Mon Oct 22 03:00:10 2012 (r241840) +++ head/lib/libfetch/http.c Mon Oct 22 03:00:15 2012 (r241841) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_MOVED_TEMP 302 #define HTTP_SEE_OTHER 303 #define HTTP_NOT_MODIFIED 304 +#define HTTP_USE_PROXY 305 #define HTTP_TEMP_REDIRECT 307 #define HTTP_PERM_REDIRECT 308 #define HTTP_NEED_AUTH 401 @@ -113,6 +114,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ || (xyz) == HTTP_MOVED_TEMP \ || (xyz) == HTTP_TEMP_REDIRECT \ + || (xyz) == HTTP_USE_PROXY \ || (xyz) == HTTP_SEE_OTHER) #define HTTP_ERROR(xyz) ((xyz) > 400 && (xyz) < 599) @@ -1697,6 +1699,7 @@ http_request(struct url *URL, const char case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: case HTTP_SEE_OTHER: + case HTTP_USE_PROXY: /* * Not so fine, but we still have to read the * headers to get the new location. @@ -1778,7 +1781,8 @@ http_request(struct url *URL, const char */ if (noredirect && conn->err != HTTP_MOVED_PERM && - conn->err != HTTP_PERM_REDIRECT) { + conn->err != HTTP_PERM_REDIRECT && + conn->err != HTTP_USE_PROXY) { n = 1; break; }