]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
In function neighborsDigestSelect(): added a check for the
authorwessels <>
Wed, 12 May 1999 00:45:46 +0000 (00:45 +0000)
committerwessels <>
Wed, 12 May 1999 00:45:46 +0000 (00:45 +0000)
request->flag.hierarchical flag.  If the flag is not set, then
we should not use cache digests to select a neighbor.

Normally this was not a problem because non-hierarchical
requests are usually also non-cachable, and digests only
include cachable objects.  However, it seems that we sometimes
get false hits from the digest for non-hierarchical objects,
specifically a POST request.

If the POST goes to a sibling, we'll add only-if-cached.  Of course
the POST response should not be cached, so the response is 504
Gateway Timeout.  The originating cache can not re-forward the
request because it was a POST (well, maybe it could, but thats
a slippery slope).  The user gets the ugly cache-miss and
only-if-cached error message.

src/neighbors.cc

index dc4ac12473eb0091984b5a7f4f48b9c15a80805c..bc84c7b9bd1dd58f7138fb92f331e308c6bb0fee 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.273 1999/05/04 21:58:28 wessels Exp $
+ * $Id: neighbors.cc,v 1.274 1999/05/11 18:45:46 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -565,7 +565,8 @@ neighborsDigestSelect(request_t * request, StoreEntry * entry)
     peer *p;
     int p_rtt;
     int i;
-
+    if (!request->flags.hierarchical)
+       return NULL;
     key = storeKeyPublic(storeUrl(entry), request->method);
     for (i = 0, p = first_ping; i++ < Config.npeers; p = p->next) {
        lookup_t lookup;