]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.3.DEVEL3.allow_miss_peer_option.patch
authorhno <>
Wed, 3 May 2000 00:51:50 +0000 (00:51 +0000)
committerhno <>
Wed, 3 May 2000 00:51:50 +0000 (00:51 +0000)
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.

ChangeLog
src/cache_cf.cc
src/cf.data.pre
src/http.cc
src/structs.h

index 2e2953114d51846567d9b8557da41256263b7f31..48e3d3c72132174cf2abf61da400a138db67b0b6 100644 (file)
--- 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 ():
 
index fc7c7b1bff2813c39370c9cd4280ec515f6128ab..bbae7e8ad25d7a1230ed2475ff52f82cb6dfc4d3 100644 (file)
@@ -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();
index 2d9c1b5c273dd6821606f4d6af664375ac2d1251..fc28049fc1586a49ed76096438a7439e1c16587e 100644 (file)
@@ -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
index 2272a0db7df31dbeae26ab3e2c92c9eb406f8fb2..b1ed674d746d5edc2ab74472c22d5b4ca3b92053 100644 (file)
@@ -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,
index d25e356512425f5660dafccd81d2413c6cf39eb4..3f30fef2505e132901f8972a8e4ae354bfa5c9c0 100644 (file)
@@ -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 {