Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2012 04:18:34 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r242292 - stable/7/lib/libfetch
Message-ID:  <201210290418.q9T4IYEp074679@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Mon Oct 29 04:18:34 2012
New Revision: 242292
URL: http://svn.freebsd.org/changeset/base/242292

Log:
  MFC r241841:
  	Implement HTTP 305 redirect handling.
  
  PR:		172452
  Approved by:	cperciva (implicit)

Modified:
  stable/7/lib/libfetch/http.c
Directory Properties:
  stable/7/lib/libfetch/   (props changed)

Modified: stable/7/lib/libfetch/http.c
==============================================================================
--- stable/7/lib/libfetch/http.c	Mon Oct 29 04:18:33 2012	(r242291)
+++ stable/7/lib/libfetch/http.c	Mon Oct 29 04:18:34 2012	(r242292)
@@ -95,6 +95,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
@@ -105,6 +106,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)
@@ -1682,6 +1684,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.
@@ -1763,7 +1766,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;
                                 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210290418.q9T4IYEp074679>