From: hno <> Date: Wed, 3 May 2000 00:51:50 +0000 (+0000) Subject: hno squid-2.3.DEVEL3.allow_miss_peer_option.patch X-Git-Tag: SQUID_3_0_PRE1~2027 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=987de78343240d041ae260d6fbb52479098f2366;p=thirdparty%2Fsquid.git hno squid-2.3.DEVEL3.allow_miss_peer_option.patch Squid-2.3.DEVEL3: allow-miss cache_peer option allow-miss cache peer option to disable the use of "only-if-cached" on requests to siblings. This can be useful in some peering arrangements where icp_hit_stale is enabled. --- diff --git a/ChangeLog b/ChangeLog index 2e2953114d..48e3d3c721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,8 @@ Changes to Squid-2.4.DEVEL3 (): differences between parents and siblings. - No longer starts to swap out objects which are known to be above the maximum allowed size. + - allow-miss cache_peer option disabling the use of "only-if-cached". + Meant to be used in conjunction with icp_hit_stale. Changes to Squid-2.4.DEVEL2 (): diff --git a/src/cache_cf.cc b/src/cache_cf.cc index fc7c7b1bff..bbae7e8ad2 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.338 2000/05/02 18:32:40 hno Exp $ + * $Id: cache_cf.cc,v 1.339 2000/05/02 18:51:50 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1005,6 +1005,8 @@ parse_peer(peer ** head) } else if (!strncasecmp(token, "digest-url=", 11)) { p->digest_url = xstrdup(token + 11); #endif + } else if (!strcasecmp(token, "allow-miss")) { + p->options.allow_miss = 1; } else { debug(3, 0) ("parse_peer: token='%s'\n", token); self_destruct(); diff --git a/src/cf.data.pre b/src/cf.data.pre index 2d9c1b5c27..fc28049fc1 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.169 2000/05/02 18:35:09 hno Exp $ +# $Id: cf.data.pre,v 1.170 2000/05/02 18:51:51 hno Exp $ # # # SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -234,6 +234,7 @@ DOC_START login=user:password connect-timeout=nn digest-url=url + allow-miss use 'proxy-only' to specify that objects fetched from this cache should not be saved locally. @@ -291,12 +292,20 @@ DOC_START the specified URL rather than the Squid default location. + use 'allow-miss' to disable Squid's use of only-if-cached + when forwarding requests to siblings. This is primarily + useful when icp_hit_stale is used by the sibling. To + extensive use of this option may result in forwarding + loops, and you should avoid having two-way peerings + with this option. (for example to deny peer usage on + requests from peer by denying cache_peer_access if the + source is a peer) + NOTE: non-ICP neighbors must be specified as 'parent'. cache_peer hostname type 3128 3130 DOC_END - NAME: cache_peer_domain cache_host_domain TYPE: hostdomain DEFAULT: none diff --git a/src/http.cc b/src/http.cc index 2272a0db7d..b1ed674d74 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.357 2000/03/25 04:58:39 wessels Exp $ + * $Id: http.cc,v 1.358 2000/05/02 18:51:51 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -866,7 +866,8 @@ httpSendRequest(HttpStateData * httpState) else if ((double) p->stats.n_keepalives_recv / (double) p->stats.n_keepalives_sent > 0.50) httpState->flags.keepalive = 1; if (httpState->peer) - if (neighborType(httpState->peer, httpState->request) == PEER_SIBLING) + if (neighborType(httpState->peer, httpState->request) == PEER_SIBLING && + !httpState->peer->options.allow_miss) httpState->flags.only_if_cached = 1; memBufDefInit(&mb); httpBuildRequestPrefix(req, diff --git a/src/structs.h b/src/structs.h index d25e356512..3f30fef250 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.319 2000/05/02 18:35:09 hno Exp $ + * $Id: structs.h,v 1.320 2000/05/02 18:51:51 hno Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1093,6 +1093,7 @@ struct _peer { #if DELAY_POOLS unsigned int no_delay:1; #endif + unsigned int allow_miss:1; } options; int weight; struct {