From: serassio <> Date: Sun, 26 Feb 2006 20:43:05 +0000 (+0000) Subject: Bug #1482: persistent_connection_after_error directive X-Git-Tag: SQUID_3_0_PRE4~309 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58850d1535a0040596ccab87ec37bd50c38f5e57;p=thirdparty%2Fsquid.git Bug #1482: persistent_connection_after_error directive 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. --- diff --git a/src/cf.data.pre b/src/cf.data.pre index fd7b3078fa..6015f28c2a 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index fca5efc6e6..2de1b9bd5c 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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; diff --git a/src/structs.h b/src/structs.h index 47d3f0bf03..570f392237 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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;