From 030588024cf3473be48b6ac30921b78851ca2f50 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 12 May 1999 00:45:46 +0000 Subject: [PATCH] In function neighborsDigestSelect(): added a check for the 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/neighbors.cc b/src/neighbors.cc index dc4ac12473..bc84c7b9bd 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -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; -- 2.47.3