]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
unifiy DIGEST #ifdefs into USE_CACHE_DIGESTS
authorwessels <>
Fri, 24 Apr 1998 12:08:13 +0000 (12:08 +0000)
committerwessels <>
Fri, 24 Apr 1998 12:08:13 +0000 (12:08 +0000)
12 files changed:
ChangeLog
configure.in
src/CacheDigest.cc
src/client_side.cc
src/enums.h
src/neighbors.cc
src/peer_digest.cc
src/peer_select.cc
src/stat.cc
src/store.cc
src/store_digest.cc
src/structs.h

index 5c74f8f1302b635621bf71bcbb1f8f17654d898f..9908cd20994ff45927d4a0c5947b29984c5fa9c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,9 @@
          and ALIVE neighbors (Joe Ramey).
        - Fixed FTP directory parsing bugs.
        - Fixed daylight savings time bug (again).
+       - Changed error message to 'Generated TIME by HOST (SQUID/VER)'
+         because any string with an '@' must be an email address.
+
 
 Changes to squid-1.2.beta19 (Apr 8, 1998):
 
index 7fbb5ce0206d0f4cee12a88480506cd3e795c14d..0e5310eca41a36639fd3e33f15bcde1478beb1e1 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.121 1998/04/24 06:00:01 wessels Exp $
+dnl  $Id: configure.in,v 1.122 1998/04/24 06:08:14 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.121 $)dnl
+AC_REVISION($Revision: 1.122 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -340,19 +340,11 @@ AC_ARG_ENABLE(forw-via-db,
   fi
 ])
 
-AC_ARG_ENABLE(cache-digest,
-[  --enable-cache-digest   Maintain a digest of our cache ],
+AC_ARG_ENABLE(cache-digests,
+[  --enable-cache-digests  Use Cache Digests],
 [ if test "$enableval" = "yes" ; then
-    echo "SQUID_MAINTAIN_CACHE_DIGEST enabled"
-    AC_DEFINE(SQUID_MAINTAIN_CACHE_DIGEST)
-  fi
-])
-
-AC_ARG_ENABLE(peer-digests,
-[  --enable-peer-digests   Query peers for their cache digests],
-[ if test "$enableval" = "yes" ; then
-    echo "SQUID_PEER_DIGEST enabled"
-    AC_DEFINE(SQUID_PEER_DIGEST)
+    echo "USE_CACHE_DIGESTS enabled"
+    AC_DEFINE(USE_CACHE_DIGESTS)
   fi
 ])
 
index b7a06da9137100dc2c93b7db8c4f51cae41cb9cf..5684e37f8c79791933f13c98428d9383ca257d3d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: CacheDigest.cc,v 1.15 1998/04/22 16:20:55 rousskov Exp $
+ * $Id: CacheDigest.cc,v 1.16 1998/04/24 06:08:15 wessels Exp $
  *
  * DEBUG: section 70    Cache Digest
  * AUTHOR: Alex Rousskov
@@ -161,7 +161,7 @@ cacheDigestAdd(CacheDigest * cd, const cache_key * key)
            CBIT_SET(cd->mask, hashed_keys[3]);
            on_xition_cnt++;
        }
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
        statHistCount(&Counter.cd.on_xition_count, on_xition_cnt);
 #endif
     }
index 9a294628fe96c738910f63b73cd5d26c7fd762fb..f757471621085078e373bfff19f85152acf78d00 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.289 1998/04/24 05:05:10 wessels Exp $
+ * $Id: client_side.cc,v 1.290 1998/04/24 06:08:16 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -534,7 +534,7 @@ clientUpdateCounters(clientHttpRequest * http)
 {
     int svc_time = tvSubMsec(http->start, current_time);
     icp_ping_data *i;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     const HttpReply *reply = NULL;
     int sst = 0;               /* server-side service time */
     HierarchyLogEntry *H;
@@ -576,7 +576,7 @@ clientUpdateCounters(clientHttpRequest * http)
        statHistCount(&Counter.icp.query_svc_time, tvSubUsec(i->start, i->stop));
     if (i->timeout)
        Counter.icp.query_timeouts++;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     H = &http->request->hier;
     if (H->peer_select_start.tv_sec && H->store_complete_stop.tv_sec)
        sst = tvSubMsec(H->peer_select_start, H->store_complete_stop);
@@ -596,7 +596,7 @@ clientUpdateCounters(clientHttpRequest * http)
     }
     /*
      * account for outgoing digest traffic (this has nothing to do with
-     * SQUID_PEER_DIGEST, but counters are all in SQUID_PEER_DIGEST ifdefs)
+     * USE_CACHE_DIGESTS, but counters are all in USE_CACHE_DIGESTS ifdefs)
      */
     if (http->flags.internal && strStr(http->request->urlpath, StoreDigestUrlPath)) {
        kb_incr(&Counter.cd.kbytes_sent, http->out.size);
@@ -1026,7 +1026,7 @@ clientBuildReplyHeader(clientHttpRequest * http,
        isTcpHit(http->log_type) ? "HIT" : "MISS",
        getMyHostname());
     clientAppendReplyHeader(hdr_out, ybuf, &len, out_sz);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     /* Append X-Cache-Lookup: -- temporary hack, to be removed @?@ @?@ */
     snprintf(ybuf, 4096, "X-Cache-Lookup: %s from %s:%d",
        http->lookup_type ? http->lookup_type : "NONE",
@@ -1469,7 +1469,7 @@ clientProcessRequest2(clientHttpRequest * http)
     const cache_key *key = storeKeyPublic(http->uri, r->method);
     StoreEntry *e;
     e = http->entry = storeGet(key);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     http->lookup_type = e ? "HIT" : "MISS";
 #endif
     if (!e) {
index 070d7fef01071d632f8a404021658383ccfacac0..e1e9ecf5674f5b78d4c0871f4a675f8b3c812813 100644 (file)
@@ -264,7 +264,7 @@ typedef enum {
     NO_DIRECT_FAIL,
     SOURCE_FASTEST,
     ROUNDROBIN_PARENT,
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     CACHE_DIGEST_HIT,
     NO_CACHE_DIGEST_DIRECT,
 #endif
index 91a6655b7fff4ca02a39d7244cac89f7c47b8b30..d6440a1a6870b7083a0de311f594608836851889 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.199 1998/04/23 19:29:12 wessels Exp $
+ * $Id: neighbors.cc,v 1.200 1998/04/24 06:08:18 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -551,7 +551,7 @@ neighborsUdpPing(request_t * request,
 lookup_t
 peerDigestLookup(peer *p, request_t * request, StoreEntry * entry)
 {
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     const cache_key *key = request ? storeKeyPublic(storeUrl(entry), request->method) : NULL;
     assert(p);
     assert(request);
@@ -589,7 +589,7 @@ peer *
 neighborsDigestSelect(request_t * request, StoreEntry * entry)
 {
     peer *best_p = NULL;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     const cache_key *key;
     int best_rtt = 0;
     int choice_count = 0;
@@ -637,7 +637,7 @@ neighborsDigestSelect(request_t * request, StoreEntry * entry)
 void
 peerNoteDigestLookup(request_t * request, peer *p, lookup_t lookup)
 {
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     if (p)
        strncpy(request->hier.cd_host, p->host, sizeof(request->hier.cd_host));
     else
index 71eb50f0ac7804e860e1b047d646870914b32e73..c6bbe94667e02c7234f27cca6194d7009316362e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.17 1998/04/23 03:21:17 rousskov Exp $
+ * $Id: peer_digest.cc,v 1.18 1998/04/24 06:08:19 wessels Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -31,7 +31,7 @@
 
 #include "squid.h"
 
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
 
 /* local types */
 
index 66d7fbe014ad64800677cae60d7174301882c12a..60e798873a4f7cb3f86df663568cf2cf720e0e4f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.52 1998/04/22 16:24:14 rousskov Exp $
+ * $Id: peer_select.cc,v 1.53 1998/04/24 06:08:20 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -47,7 +47,7 @@ const char *hier_strings[] =
     "NO_DIRECT_FAIL",
     "SOURCE_FASTEST",
     "ROUNDROBIN_PARENT",
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     "CACHE_DIGEST_HIT",
     "NO_CACHE_DIGEST_DIRECT",
 #endif
@@ -146,7 +146,7 @@ peerSelect(request_t * request,
     psstate->callback = callback;
     psstate->fail_callback = fail_callback;
     psstate->callback_data = callback_data;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     request->hier.peer_select_start = current_time;
 #endif
     cbdataLock(callback_data);
@@ -307,7 +307,7 @@ peerSelectFoo(ps_state * psstate)
        debug(44, 3) ("peerSelect: found single parent, skipping ICP query\n");
     } else if (peerSelectIcpPing(request, direct, entry)) {
        assert(entry->ping_status == PING_NONE);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
        /* which algorithm to use? */
        if (squid_random() & 1) {
            debug(44, 2) ("peerSelect: Using Cache Digest\n");
@@ -359,7 +359,7 @@ peerSelectFoo(ps_state * psstate)
                    Config.neighborTimeout);
                return;
            }
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
        }
 #endif
     }
@@ -459,7 +459,7 @@ peerHandleIcpReply(peer * p, peer_t type, icp_common_t * header, void *data)
     debug(44, 3) ("peerHandleIcpReply: %s %s\n",
        icp_opcode_str[op],
        storeUrl(psstate->entry));
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     /* do cd lookup to count false misses */
     if (p && request)
        peerNoteDigestLookup(request, p, 
index ba8bc05c22731921745773620bf11c9dc650525d..76749ea27a0e8ae36c4aea315b7ee577e71d00a2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.243 1998/04/22 16:24:13 rousskov Exp $
+ * $Id: stat.cc,v 1.244 1998/04/24 06:08:21 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -656,7 +656,7 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours)
     storeAppendPrintf(sentry, "client_http.hit_median_svc_time = %f seconds\n",
        x / 1000.0);
 
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     storeAppendPrintf(sentry, "cd.msgs_sent = %f/sec\n",
        XAVG(cd.msgs_sent));
     storeAppendPrintf(sentry, "cd.msgs_recv = %f/sec\n",
@@ -876,7 +876,7 @@ statCountersInitSpecial(StatCounters * C)
      * DNS svc_time hist is kept in milli-seconds; max of 10 minutes.
      */
     statHistLogInit(&C->dns.svc_time, 300, 0.0, 60000.0 * 10.0);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     /*
      * Digested and ICPed cvs times in milli-seconds; max of 3 hours.
      */
@@ -902,7 +902,7 @@ statCountersClean(StatCounters * C)
     statHistClean(&C->icp.query_svc_time);
     statHistClean(&C->icp.reply_svc_time);
     statHistClean(&C->dns.svc_time);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     statHistClean(&C->cd.client_svc_time);
     statHistClean(&C->icp.client_svc_time);
     statHistClean(&C->cd.server_svc_time);
@@ -931,7 +931,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig)
     statHistCopy(&dest->icp.query_svc_time, &orig->icp.query_svc_time);
     statHistCopy(&dest->icp.reply_svc_time, &orig->icp.reply_svc_time);
     statHistCopy(&dest->dns.svc_time, &orig->dns.svc_time);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     statHistCopy(&dest->cd.client_svc_time, &orig->cd.client_svc_time);
     statHistCopy(&dest->icp.client_svc_time, &orig->icp.client_svc_time);
     statHistCopy(&dest->cd.server_svc_time, &orig->cd.server_svc_time);
@@ -945,7 +945,6 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig)
 static void
 statCountersHistograms(StoreEntry * sentry)
 {
-    StatCounters *f = &Counter;
 #if TOO_MUCH_OUTPUT
     storeAppendPrintf(sentry, "client_http.all_svc_time histogram:\n");
     statHistDump(&f->client_http.all_svc_time, sentry, NULL);
@@ -956,7 +955,8 @@ statCountersHistograms(StoreEntry * sentry)
     storeAppendPrintf(sentry, "client_http.hit_svc_time histogram:\n");
     statHistDump(&f->client_http.hit_svc_time, sentry, NULL);
 #endif
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
+    StatCounters *f = &Counter;
     storeAppendPrintf(sentry, "\nicp.query_svc_time histogram:\n");
     statHistDump(&f->icp.query_svc_time, sentry, NULL);
     storeAppendPrintf(sentry, "\nicp.reply_svc_time histogram:\n");
@@ -1075,7 +1075,7 @@ statCountersDump(StoreEntry * sentry)
     storeAppendPrintf(sentry, "icp.r_kbytes_recv = %d\n",
        (int) f->icp.r_kbytes_recv.kb);
 
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     storeAppendPrintf(sentry, "icp.times_used = %d\n",
        f->icp.times_used);
     storeAppendPrintf(sentry, "cd.times_used = %d\n",
@@ -1109,7 +1109,7 @@ statCountersDump(StoreEntry * sentry)
 static void
 statPeerSelect(StoreEntry * sentry)
 {
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     StatCounters *f = &Counter;
     peer *peer;
     const int tot_used = f->cd.times_used + f->icp.times_used;
index 1b8f9bad9b8804e8161a497cf896a201e33e3e33..ffc63a317d23b19233fd04c0beabdfa6a72b9f0d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.408 1998/04/22 16:22:37 rousskov Exp $
+ * $Id: store.cc,v 1.409 1998/04/24 06:08:22 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -537,7 +537,7 @@ storeComplete(StoreEntry * e)
     assert(e->mem_status == NOT_IN_MEMORY);
     if (!storeEntryValidLength(e))
        EBIT_SET(e->flag, ENTRY_BAD_LENGTH);
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     if (e->mem_obj->request)
        e->mem_obj->request->hier.store_complete_stop = current_time;
 #endif
index a41e3ff01b73848da3163ab10dd10db33a5571c2..3cbd624a6d3d172005d02b064b71dfda4838bee6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: store_digest.cc,v 1.9 1998/04/22 16:22:58 rousskov Exp $
+ * $Id: store_digest.cc,v 1.10 1998/04/24 06:08:24 wessels Exp $
  *
  * DEBUG: section 71    Store Digest Manager
  * AUTHOR: Alex Rousskov
@@ -94,7 +94,7 @@ static int storeDigestResize();
 void
 storeDigestInit()
 {
-#if SQUID_MAINTAIN_CACHE_DIGEST
+#if USE_CACHE_DIGESTS
     const int cap = storeDigestCalcCap();
     store_digest = cacheDigestCreate(cap, StoreDigestBitsPerEntry);
     debug(71, 1) ("Local cache digest enabled; rebuild/rewrite every %d/%d sec\n",
index af27853df895c157ea968808f1294436a4471d06..ce122ba0815ed2a956686ae38761bb5e935efb52 100644 (file)
@@ -613,7 +613,7 @@ struct _HierarchyLogEntry {
     hier_code code;
     char host[SQUIDHOSTNAMELEN];
     icp_ping_data icp;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     char cd_host[SQUIDHOSTNAMELEN]; /* the host of selected by cd peer */
     peer_select_alg_t alg; /* peer selection algorithm */
     lookup_t cd_lookup;    /* cd prediction: none, miss, hit */
@@ -665,7 +665,7 @@ struct _clientHttpRequest {
     StoreEntry *entry;
     StoreEntry *old_entry;
     log_type log_type;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     const char *lookup_type;   /* temporary hack: storeGet() result: HIT/MISS/NONE */
 #endif
     http_status http_code;
@@ -1206,7 +1206,7 @@ struct _StatCounters {
        StatHist query_svc_time;
        StatHist reply_svc_time;
         int query_timeouts;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
        StatHist client_svc_time;
        StatHist server_svc_time;
        int times_used;
@@ -1218,7 +1218,7 @@ struct _StatCounters {
     struct {
        StatHist svc_time;
     } dns;
-#if SQUID_PEER_DIGEST
+#if USE_CACHE_DIGESTS
     struct {
        int times_used;
        kb_t kbytes_sent;