From: wessels <> Date: Fri, 24 Apr 1998 12:08:13 +0000 (+0000) Subject: unifiy DIGEST #ifdefs into USE_CACHE_DIGESTS X-Git-Tag: SQUID_3_0_PRE1~3432 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cfa89663504da6d0754cd9890d5afa7d3d7ea01;p=thirdparty%2Fsquid.git unifiy DIGEST #ifdefs into USE_CACHE_DIGESTS --- diff --git a/ChangeLog b/ChangeLog index 5c74f8f130..9908cd2099 100644 --- 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): diff --git a/configure.in b/configure.in index 7fbb5ce020..0e5310eca4 100644 --- a/configure.in +++ b/configure.in @@ -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 ]) diff --git a/src/CacheDigest.cc b/src/CacheDigest.cc index b7a06da913..5684e37f8c 100644 --- a/src/CacheDigest.cc +++ b/src/CacheDigest.cc @@ -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 } diff --git a/src/client_side.cc b/src/client_side.cc index 9a294628fe..f757471621 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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) { diff --git a/src/enums.h b/src/enums.h index 070d7fef01..e1e9ecf567 100644 --- a/src/enums.h +++ b/src/enums.h @@ -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 diff --git a/src/neighbors.cc b/src/neighbors.cc index 91a6655b7f..d6440a1a68 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -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 diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 71eb50f0ac..c6bbe94667 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -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 */ diff --git a/src/peer_select.cc b/src/peer_select.cc index 66d7fbe014..60e798873a 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -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, diff --git a/src/stat.cc b/src/stat.cc index ba8bc05c22..76749ea27a 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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; diff --git a/src/store.cc b/src/store.cc index 1b8f9bad9b..ffc63a317d 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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 diff --git a/src/store_digest.cc b/src/store_digest.cc index a41e3ff01b..3cbd624a6d 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -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", diff --git a/src/structs.h b/src/structs.h index af27853df8..ce122ba081 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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;