]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1482: persistent_connection_after_error directive
authorserassio <>
Sun, 26 Feb 2006 20:43:05 +0000 (20:43 +0000)
committerserassio <>
Sun, 26 Feb 2006 20:43:05 +0000 (20:43 +0000)
a new persistent_connection_after_error directive enabling/disabling the
use of persistent connections after error. If set to off then it behaves
very close to Squid-2.4 even if you have persistent connections enabled

Forward of 2.5 patch.

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

index fd7b3078facb33bc97b8e5b12a37cdfaac35a306..6015f28c2a3a5414e35a04855094f8e3893c33b5 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.410 2006/02/21 22:23:20 hno Exp $
+# $Id: cf.data.pre,v 1.411 2006/02/26 13:43:05 serassio Exp $
 #
 #
 # SQUID Web Proxy Cache                http://www.squid-cache.org/
@@ -4552,17 +4552,14 @@ DOC_START
        disable persistent connections with clients and/or servers.
 DOC_END
 
-NAME: balance_on_multiple_ip
+NAME: persistent_connection_after_error
 TYPE: onoff
-LOC: Config.onoff.balance_on_multiple_ip
-DEFAULT: on
+LOC: Config.onoff.error_pconns
+DEFAULT: off
 DOC_START
-       Some load balancing servers based on round robin DNS have been
-       found not to preserve user session state across requests
-       to different IP addresses.
-
-       By default Squid rotates IP's per request. By disabling
-       this directive only connection failure triggers rotation.
+       With this directive the use of persistent connections after
+       HTTP errors can be disabled. Useful if you have clients
+       who fail to handle errors on persistent connections proper.
 DOC_END
 
 NAME: detect_broken_pconn
@@ -4580,6 +4577,19 @@ DOC_START
        after 10 seconds timeout.
 DOC_END
 
+NAME: balance_on_multiple_ip
+TYPE: onoff
+LOC: Config.onoff.balance_on_multiple_ip
+DEFAULT: on
+DOC_START
+       Some load balancing servers based on round robin DNS have been
+       found not to preserve user session state across requests
+       to different IP addresses.
+
+       By default Squid rotates IP's per request. By disabling
+       this directive only connection failure triggers rotation.
+DOC_END
+
 NAME: pipeline_prefetch
 TYPE: onoff
 LOC: Config.onoff.pipeline_prefetch
index fca5efc6e6a4aa7b709a9d40d52774210d4eda65..2de1b9bd5c8f07376cf965bf3138eb0c0e74cc81 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.98 2006/02/20 22:43:06 wessels Exp $
+ * $Id: client_side_reply.cc,v 1.99 2006/02/26 13:43:05 serassio Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -1418,6 +1418,11 @@ clientReplyContext::buildReplyHeader()
         request->flags.proxy_keepalive = 0;
     }
 
+    if (!Config.onoff.error_pconns && reply->sline.status >= 400 && !request->flags.must_keepalive) {
+        debug(33, 3) ("clientBuildReplyHeader: Error, don't keep-alive\n");
+        request->flags.proxy_keepalive = 0;
+    }
+
     if (!Config.onoff.client_pconns && !request->flags.must_keepalive)
         request->flags.proxy_keepalive = 0;
 
index 47d3f0bf03e4c95e4afec18ba83241f3c43729df..570f39223797c80c4ca5094230865c9a79442896 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.533 2006/01/03 17:22:31 wessels Exp $
+ * $Id: structs.h,v 1.534 2006/02/26 13:43:05 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -556,6 +556,7 @@ struct _SquidConfig
         int ignore_unknown_nameservers;
         int client_pconns;
         int server_pconns;
+        int error_pconns;
 #if USE_CACHE_DIGESTS
 
         int digest_generation;