]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
2.0 branch merge
authorwessels <>
Thu, 8 Oct 1998 08:40:01 +0000 (08:40 +0000)
committerwessels <>
Thu, 8 Oct 1998 08:40:01 +0000 (08:40 +0000)
ChangeLog
src/StatHist.cc
src/client_side.cc
src/comm.cc
src/neighbors.cc
src/structs.h

index 2766c83707bc6e7d9ce0e250ed253fea219a3354..da841a2c9a2f28573ea1d230ddaa46b0d414a9a1 100644 (file)
--- 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):
 
index 49753ed3136095dae8d3740789a7eecfdbcdb5f3..990364c335e9e39e2f9061ed7042b8399117397b 100644 (file)
@@ -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)
index e79772361566469ac3d22da1c305fcd2af75251a..27d735d2bb20f5c22f70386252f73388c19ccfda 100644 (file)
@@ -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,
index ca9440e433ce88a8c9d05c207e8b8b1cb100fe41..eec94c1f656f1efa18144983a3680b8394c9b5ef 100644 (file)
@@ -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;
index 5819b7ca0a1770b65cda7c9eee356250628418c0..bcddd0130a382219534153699bff2561983a81c9 100644 (file)
@@ -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");
index 6b2a4334c318a9be228c8b7da3ac4aa73513ba5a..ea815a43d94da7d41fdf25d882548aaee26d7862 100644 (file)
@@ -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