From: wessels <> Date: Thu, 8 Oct 1998 08:40:01 +0000 (+0000) Subject: 2.0 branch merge X-Git-Tag: SQUID_3_0_PRE1~2603 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9689d97cb87b7e50a8956c16d48bfac0544b1bfb;p=thirdparty%2Fsquid.git 2.0 branch merge --- diff --git a/ChangeLog b/ChangeLog index 2766c83707..da841a2c9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,15 @@ Changes to Squid-2.0 (October 2, 1998): ENTRY_BAD_LENGTH set. We should release the bad entry to prevent secondary clients jumping on. - Changed MIB to prevent parse warnings at startup. + - Fixed a forwarding loop bug. Even though we were detecting + a loop, it was not being broken. + - Try to prevent sibling forwarding loops by NOT forwarding a + request to a sibling if we have a stale copy of the object. + Validation requests should only be sent to parents (or + direct). + - Fixed ncsa_auth hash bugs when re-reading password file. + - Changed clientHierarchical() so that by default SSL/CONNECT + requests do NOT go to neighbor caches. Changes to squid-1.2.beta25 (September 21, 1998): diff --git a/src/StatHist.cc b/src/StatHist.cc index 49753ed313..990364c335 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -1,6 +1,6 @@ /* - * $Id: StatHist.cc,v 1.13 1998/10/03 03:56:51 wessels Exp $ + * $Id: StatHist.cc,v 1.14 1998/10/08 02:40:04 wessels Exp $ * * DEBUG: section 62 Generic Histogram * AUTHOR: Duane Wessels @@ -218,12 +218,13 @@ statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper * bd) static double Log(double x) { - return log(x + 1); + assert((x + 1.0) >= 0.0); + return log(x + 1.0); } static double Exp(double x) { - return exp(x) - 1; + return exp(x) - 1.0; } void statHistLogInit(StatHist * H, int capacity, double min, double max) diff --git a/src/client_side.cc b/src/client_side.cc index e797723615..27d735d2bb 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.406 1998/10/03 03:56:52 wessels Exp $ + * $Id: client_side.cc,v 1.407 1998/10/08 02:40:05 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -832,6 +832,8 @@ clientHierarchical(clientHttpRequest * http) return 1; if (method != METHOD_GET) return 0; + if (method != METHOD_CONNECT) + return 0; /* scan hierarchy_stoplist */ for (p = Config.hierarchy_stoplist; p; p = p->next) if (strstr(url, p->key)) @@ -1157,6 +1159,14 @@ clientCacheHit(void *data, char *buf, ssize_t size) /* * We hold a stale copy; it needs to be validated */ + /* + * The 'need_validation' flag is used to prevent forwarding + * loops between siblings. If our copy of the object is stale, + * then we should probably only use parents for the validation + * request. Otherwise two siblings could generate a loop if + * both have a stale version of the object. + */ + r->flags.need_validation = 1; if (e->lastmod < 0) { /* * Previous reply didn't have a Last-Modified header, diff --git a/src/comm.cc b/src/comm.cc index ca9440e433..eec94c1f65 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.287 1998/10/01 22:28:26 wessels Exp $ + * $Id: comm.cc,v 1.288 1998/10/08 02:40:06 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -404,7 +404,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address) fde *F = &fd_table[sock]; int x; int err = 0; - int errlen; + socklen_t errlen; assert(ntohs(address->sin_port) != 0); /* Establish connection. */ errno = 0; diff --git a/src/neighbors.cc b/src/neighbors.cc index 5819b7ca0a..bcddd0130a 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.256 1998/10/03 03:56:54 wessels Exp $ + * $Id: neighbors.cc,v 1.257 1998/10/08 02:40:07 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -122,12 +122,16 @@ peerAllowedToUse(const peer * p, request_t * request) int do_ping = 1; aclCheck_t checklist; assert(request != NULL); - if (request->flags.nocache) - if (neighborType(p, request) == PEER_SIBLING) + if (neighborType(p, request) == PEER_SIBLING) { + if (request->flags.nocache) return 0; - if (request->flags.refresh) - if (neighborType(p, request) == PEER_SIBLING) + if (request->flags.refresh) return 0; + if (request->flags.loopdetect) + return 0; + if (request->flags.need_validation) + return 0; + } if (p->pinglist == NULL && p->access == NULL) return do_ping; do_ping = 0; @@ -493,8 +497,8 @@ peerDigestLookup(peer * p, request_t * request, StoreEntry * entry) if (p->digest.flags.disabled) { debug(15, 5) ("peerDigestLookup: Disabled!\n"); return LOOKUP_NONE; - } else if (!peerAllowedToUse(p, request)) { - debug(15, 5) ("peerDigestLookup: !peerAllowedToUse()\n"); + } else if (!peerHTTPOkay(p, request)) { + debug(15, 5) ("peerDigestLookup: !peerHTTPOkay()\n"); return LOOKUP_NONE; } else if (p->digest.flags.usable) { debug(15, 5) ("peerDigestLookup: Usable!\n"); diff --git a/src/structs.h b/src/structs.h index 6b2a4334c3..ea815a43d9 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,8 +1,6 @@ - - /* - * $Id: structs.h,v 1.237 1998/09/30 02:53:19 wessels Exp $ + * $Id: structs.h,v 1.238 1998/10/08 02:40:09 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1266,6 +1264,7 @@ struct _request_flags { unsigned int refresh:1; unsigned int used_proxy_auth:1; unsigned int redirected:1; + unsigned int need_validation:1; #if HTTP_VIOLATIONS unsigned int nocache_hack:1; /* for changing/ignoring no-cache requests */ #endif