]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1210: 403 replies and many other server generated errors should not
authorserassio <>
Sun, 27 Feb 2005 23:36:06 +0000 (23:36 +0000)
committerserassio <>
Sun, 27 Feb 2005 23:36:06 +0000 (23:36 +0000)
be retried. (RFC2616)

Retrying these is a slight violation to the RFC, even if it may be
useful in certain complex hierarchy cases to work around
misconfigured or malfunctioning peers.

This patch adds a new squid.conf directive "retry_on_error" to revert
back to the old mode of aggressively retry requests on errors.

Forward port of 2.5 patch.

src/cf.data.pre
src/forward.cc
src/structs.h

index 9f994933b898acbc96df20adc222cdd4271fd0f1..adb65c1e4320e4c9a9638093799192b320d80006 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.375 2005/02/19 16:03:33 hno Exp $
+# $Id: cf.data.pre,v 1.376 2005/02/27 16:36:06 serassio Exp $
 #
 #
 # SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -3775,6 +3775,17 @@ DOC_START
        takes place if Squid fails to get a satisfying response.
 DOC_END
 
+NAME: retry_on_error
+TYPE: onoff
+LOC: Config.retry.onerror
+DEFAULT: off
+DOC_START
+       If set to on Squid will automatically retry requests when
+       receiving an error response. This is mainly useful if you
+       are in a complex cache hierarchy to work around access
+       control errors.
+DOC_END
+
 NAME: snmp_port
 TYPE: ushort
 LOC: Config.Port.snmp
index 7b8063dbff312e23b147579ddc4879f96eef1638..d2916bee2556696c0726b8a675f2980c7c1bd3db 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.124 2004/12/20 16:30:35 robertc Exp $
+ * $Id: forward.cc,v 1.125 2005/02/27 16:36:07 serassio Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -1111,18 +1111,19 @@ fwdReforwardableStatus(http_status s)
 {
     switch (s) {
 
+    case HTTP_BAD_GATEWAY:
+
+    case HTTP_GATEWAY_TIMEOUT:
+        return 1;
+
     case HTTP_FORBIDDEN:
 
     case HTTP_INTERNAL_SERVER_ERROR:
 
     case HTTP_NOT_IMPLEMENTED:
 
-    case HTTP_BAD_GATEWAY:
-
     case HTTP_SERVICE_UNAVAILABLE:
-
-    case HTTP_GATEWAY_TIMEOUT:
-        return 1;
+        return Config.retry.onerror;
 
     default:
         return 0;
index 652f050c523085ea99288b83c6e3f5fe2e9c70f9..b48af134b1e6fd295bbdf9753deaba2e45fc8968 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.508 2005/02/09 13:01:40 serassio Exp $
+ * $Id: structs.h,v 1.509 2005/02/27 16:36:07 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -643,6 +643,7 @@ struct _SquidConfig
     struct
     {
         int maxtries;
+        int onerror;
     }
 
     retry;