]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Wed, 25 Nov 1998 16:00:17 +0000 (16:00 +0000)
committerwessels <>
Wed, 25 Nov 1998 16:00:17 +0000 (16:00 +0000)
13 files changed:
src/CacheDigest.cc
src/cache_cf.cc
src/client.cc
src/debug.cc
src/dnsserver.cc
src/globals.h
src/icmp.cc
src/main.cc
src/peer_digest.cc
src/protos.h
src/snmp_agent.cc
src/snmp_core.cc
src/store_digest.cc

index 948fc0807c52d540f387a7caf1e60bd9cdea8087..11bea701114234206f31214cdc089d231e47eefd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: CacheDigest.cc,v 1.27 1998/11/13 21:02:01 rousskov Exp $
+ * $Id: CacheDigest.cc,v 1.28 1998/11/25 09:00:17 wessels Exp $
  *
  * DEBUG: section 70    Cache Digest
  * AUTHOR: Alex Rousskov
@@ -253,7 +253,6 @@ cacheDigestGuessStatsReport(const cd_guess_stats * stats, StoreEntry * sentry, c
        storeAppendPrintf(sentry, "no guess stats for %s available\n", label);
        return;
     }
-
     storeAppendPrintf(sentry, "Digest guesses stats for %s:\n", label);
     storeAppendPrintf(sentry, "guess\t hit\t\t miss\t\t total\t\t\n");
     storeAppendPrintf(sentry, " \t #\t %%\t #\t %%\t #\t %%\t\n");
index e3927d322788fdcf6f969e72c08296cedcb9bf00..e4dbc377551b94bbe59aa5b837e3f8278bfc1089 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.311 1998/11/13 21:02:02 rousskov Exp $
+ * $Id: cache_cf.cc,v 1.312 1998/11/25 09:00:18 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -757,12 +757,12 @@ parse_peer(peer ** head)
            p->carp.hash += (p->carp.hash << 19) + *token;
     }
 #endif
-    cbdataAdd(p, MEM_PEER); /* must preceed peerDigestCreate */
+    cbdataAdd(p, MEM_PEER);    /* must preceed peerDigestCreate */
 #if USE_CACHE_DIGESTS
     if (!p->options.no_digest) {
        p->digest = peerDigestCreate(p);
-       cbdataLock(p->digest); /* so we know when/if digest disappears */
-    }  
+       cbdataLock(p->digest);  /* so we know when/if digest disappears */
+    }
 #endif
     while (*head != NULL)
        head = &(*head)->next;
index d487ac378c15b22cf34231b8896483c0a87b2a11..473bd4254510ce4cbd1c7af2a560792144aea0f6 100644 (file)
@@ -1,8 +1,6 @@
 
-
-
 /*
- * $Id: client.cc,v 1.78 1998/11/12 06:27:59 wessels Exp $
+ * $Id: client.cc,v 1.79 1998/11/25 09:00:19 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index 7ce6799fb592028af0ee9aea9f66539da78be3fb..f0bb9d00f458fde07542d2c27e756abe180450ae 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: debug.cc,v 1.72 1998/11/13 06:00:30 wessels Exp $
+ * $Id: debug.cc,v 1.73 1998/11/25 09:00:20 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -232,10 +232,10 @@ debugLogTime(time_t t)
 
 void
 xassert(const char *msg, const char *file, int line)
-{   
+{
     debug(0, 0) ("assertion failed: %s:%d: \"%s\"\n", file, line, msg);
     if (!shutting_down)
-        abort();
+       abort();
 }
 
 /*
index 1fe425a69836c006cfafcde34e03b3b09f857dfc..fa460655981da723beec52177cf6a92571ec69ae 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dnsserver.cc,v 1.54 1998/11/21 16:54:26 wessels Exp $
+ * $Id: dnsserver.cc,v 1.55 1998/11/25 09:00:20 wessels Exp $
  *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
@@ -292,22 +292,22 @@ main(int argc, char *argv[])
                 * RES_INIT is wrong.  The resolver code sets RES_INIT
                 * after calling res_init().  When we change the _res
                 * structure and set RES_INIT, some internal resolver
-                * structures get confused.             -DW 2.1.p1
+                * structures get confused.             -DW 2.1.p1
                 */
 #if SEEMS_WRONG
                _res.options |= RES_INIT;
 #endif
                opt_s = 1;
            } else if (_res.nscount == MAXNS) {
-               fprintf(stderr, "Too many -s options, only %d are allowed\n",   
-                       MAXNS);
+               fprintf(stderr, "Too many -s options, only %d are allowed\n",
+                   MAXNS);
                break;
            }
 #if HAVE_RES_NSADDR_LIST
-           _res.nsaddr_list[_res.nscount]=_res.nsaddr_list[0];
+           _res.nsaddr_list[_res.nscount] = _res.nsaddr_list[0];
            safe_inet_addr(optarg, &_res.nsaddr_list[_res.nscount++].sin_addr);
 #elif HAVE_RES_NS_LIST
-           _res.ns_list[_res.nscount]=_res.ns_list[0];
+           _res.ns_list[_res.nscount] = _res.ns_list[0];
            safe_inet_addr(optarg, &_res.ns_list[_res.nscount++].addr.sin_addr);
 #else /* Unknown NS list format */
            fprintf(stderr, "-s is not supported on this resolver\n");
index d90c3ec40bdcce52eb91e7b7d2beed23b39176f5..60ffd97229bd01124897f5ea3e850e51d21013ea 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.71 1998/11/13 21:02:04 rousskov Exp $
+ * $Id: globals.h,v 1.72 1998/11/25 09:00:21 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -130,7 +130,7 @@ extern int hot_obj_count;   /* 0 */
 extern int _db_level;
 extern const int CacheDigestHashFuncCount;     /* 4 */
 extern CacheDigest *store_digest;      /* NULL */
-extern const char *StoreDigestFileName;        /* "store_digest" */
+extern const char *StoreDigestFileName;                /* "store_digest" */
 extern const char *StoreDigestMimeStr; /* "application/cache-digest" */
 #if USE_CACHE_DIGESTS
 extern const Version CacheDigestVer;   /* { 5, 3 } */
index 5fe1a695f1aa932cda1ad5dc7e18627b9a49f5af..a29903d474d25905b5a6528764bfb176696b52cb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.67 1998/11/13 20:50:51 wessels Exp $
+ * $Id: icmp.cc,v 1.68 1998/11/25 09:00:22 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -139,6 +139,7 @@ icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf)
     /* call neighborsUdpAck even if ping_status != PING_WAITING */
     neighborsUdpAck(key, &header, from);
 }
+
 #endif
 
 #endif /* USE_ICMP */
index 8fbc0a4bb6970036348157398ee071a6e43eb969..671e05ce6a4210a65615605b908dc92932d5cf8e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.278 1998/11/13 21:02:04 rousskov Exp $
+ * $Id: main.cc,v 1.279 1998/11/25 09:00:22 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -175,7 +175,7 @@ mainParseOptions(int argc, char *argv[])
            else if (!strncmp(optarg, "check", strlen(optarg)))
                opt_send_signal = 0;    /* SIGNULL */
            else if (!strncmp(optarg, "parse", strlen(optarg)))
-               opt_parse_cfg_only = 1; /* parse cfg file only */
+               opt_parse_cfg_only = 1;         /* parse cfg file only */
            else
                usage();
            break;
@@ -526,12 +526,12 @@ main(int argc, char **argv)
        int parse_err;
        if (!ConfigFile)
            ConfigFile = xstrdup(DefaultConfigFile);
-       if (!configured_once) /* is it ever false? */ {
+       if (!configured_once) { /* is it ever false? */
            cbdataInit();
-           memInit(); /* memInit is required for config parsing */
+           memInit();          /* memInit is required for config parsing */
        }
        parse_err = parseConfigFile(ConfigFile);
-       
+
        if (opt_parse_cfg_only)
            return parse_err;
     }
index 21616605c56375389bef503fe3ebf148818e6851..bc8756b76ccad590447d6d59e446ce4005024ce4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.60 1998/11/19 22:28:51 rousskov Exp $
+ * $Id: peer_digest.cc,v 1.61 1998/11/25 09:00:23 wessels Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -71,11 +71,11 @@ static const time_t GlobDigestReqMinGap = 1 * 60;   /* seconds */
 
 /* local vars */
 
-static time_t pd_last_req_time = 0; /* last call to Check */
+static time_t pd_last_req_time = 0;    /* last call to Check */
 
 /* initialize peer digest */
 static void
-peerDigestInit(PeerDigest *pd, peer *p)
+peerDigestInit(PeerDigest * pd, peer * p)
 {
     assert(pd && p);
 
@@ -88,7 +88,7 @@ peerDigestInit(PeerDigest *pd, peer *p)
 }
 
 static void
-peerDigestClean(PeerDigest *pd)
+peerDigestClean(PeerDigest * pd)
 {
     assert(pd);
     if (pd->cd)
@@ -98,23 +98,23 @@ peerDigestClean(PeerDigest *pd)
 
 /* allocate new peer digest, call Init, and lock everything */
 PeerDigest *
-peerDigestCreate(peer *p)
+peerDigestCreate(peer * p)
 {
     PeerDigest *pd;
-    assert(p); 
+    assert(p);
     /* cannot check cbdataValid(p) because p may not be locked yet */
 
     pd = memAllocate(MEM_PEER_DIGEST);
     cbdataAdd(pd, MEM_PEER_DIGEST);
     peerDigestInit(pd, p);
-    cbdataLock(pd->peer);     /* we will use the peer */
+    cbdataLock(pd->peer);      /* we will use the peer */
 
     return pd;
 }
 
 /* call Clean and free/unlock everything */
 void
-peerDigestDestroy(PeerDigest *pd)
+peerDigestDestroy(PeerDigest * pd)
 {
     assert(pd);
     assert(cbdataValid(pd));
@@ -122,7 +122,7 @@ peerDigestDestroy(PeerDigest *pd)
     /* inform peer (if any) that we are gone */
     if (cbdataValid(pd->peer))
        peerNoteDigestGone(pd->peer);
-    cbdataUnlock(pd->peer); /* must unlock, valid or not */
+    cbdataUnlock(pd->peer);    /* must unlock, valid or not */
     pd->peer = NULL;
 
     peerDigestClean(pd);
@@ -131,7 +131,7 @@ peerDigestDestroy(PeerDigest *pd)
 
 /* called by peer to indicate that somebody actually needs this digest */
 void
-peerDigestNeeded(PeerDigest *pd)
+peerDigestNeeded(PeerDigest * pd)
 {
     assert(pd);
     assert(!pd->flags.needed);
@@ -139,19 +139,19 @@ peerDigestNeeded(PeerDigest *pd)
 
     pd->flags.needed = 1;
     pd->times.needed = squid_curtime;
-    peerDigestSetCheck(pd, 0); /* check asap */
+    peerDigestSetCheck(pd, 0); /* check asap */
 }
 
 /* currently we do not have a reason to disable without destroying */
-#if FUTURE_CODE 
+#if FUTURE_CODE
 /* disables peer for good */
 static void
-peerDigestDisable(PeerDigest *pd)
+peerDigestDisable(PeerDigest * pd)
 {
-    debug(72, 2) ("peerDigestDisable: peer %s disabled for good\n", 
+    debug(72, 2) ("peerDigestDisable: peer %s disabled for good\n",
        strBuf(pd->host));
     pd->times.disabled = squid_curtime;
-    pd->times.next_check = -1; /* never */
+    pd->times.next_check = -1; /* never */
     pd->flags.usable = 0;
 
     if (pd->cd) {
@@ -164,12 +164,12 @@ peerDigestDisable(PeerDigest *pd)
 
 /* increment retry delay [after an unsuccessful attempt] */
 static time_t
-peerDigestIncDelay(const PeerDigest *pd)
+peerDigestIncDelay(const PeerDigest * pd)
 {
     assert(pd);
     return pd->times.retry_delay > 0 ?
-       2*pd->times.retry_delay : /* exponential backoff */
-       PeerDigestReqMinGap;        /* minimal delay */
+       2 * pd->times.retry_delay :     /* exponential backoff */
+       PeerDigestReqMinGap;    /* minimal delay */
 }
 
 /* artificially increases Expires: setting to avoid race conditions 
@@ -197,7 +197,8 @@ peerDigestSetCheck(PeerDigest * pd, time_t delay)
 /* called only when cbdataValid(pd) and
  * peer is about to disappear or have already disappeared */
 void
-peerDigestNotePeerGone(PeerDigest *pd) {
+peerDigestNotePeerGone(PeerDigest * pd)
+{
     assert(cbdataValid(pd));
     if (pd->flags.requested) {
        debug(72, 2) ("peerDigest: peer %s is gone, will destroy after fetch.\n", strBuf(pd->host));
@@ -223,19 +224,18 @@ peerDigestCheck(void *data)
        cbdataUnlock(pd);
        return;
     }
-    cbdataUnlock(pd); /* non-blocking event is over */
+    cbdataUnlock(pd);          /* non-blocking event is over */
 
     assert(!pd->flags.requested);
-    pd->times.next_check = 0; /* unknown */
+    pd->times.next_check = 0;  /* unknown */
 
     if (!cbdataValid(pd->peer)) {
        peerDigestNotePeerGone(pd);
        return;
     }
-
     debug(72, 3) ("peerDigestCheck: peer %s:%d\n", pd->peer->host, pd->peer->http_port);
     debug(72, 3) ("peerDigestCheck: time: %d, last received: %d (%+d)\n",
-       squid_curtime, pd->times.received, (squid_curtime-pd->times.received));
+       squid_curtime, pd->times.received, (squid_curtime - pd->times.received));
 
     /* decide when we should send the request:
      * request now unless too close to other requests */
@@ -244,7 +244,7 @@ peerDigestCheck(void *data)
     /* per-peer limit */
     if (req_time - pd->times.received < PeerDigestReqMinGap) {
        debug(72, 2) ("peerDigestCheck: %s, avoiding close peer requests (%d < %d secs).\n",
-           strBuf(pd->host), req_time - pd->times.received, 
+           strBuf(pd->host), req_time - pd->times.received,
            PeerDigestReqMinGap);
        req_time = pd->times.received + PeerDigestReqMinGap;
     }
@@ -255,9 +255,8 @@ peerDigestCheck(void *data)
            GlobDigestReqMinGap);
        req_time = pd_last_req_time + GlobDigestReqMinGap;
     }
-
     if (req_time <= squid_curtime)
-       peerDigestRequest(pd); /* will set pd->flags.requested */
+       peerDigestRequest(pd);  /* will set pd->flags.requested */
     else
        peerDigestSetCheck(pd, req_time - squid_curtime);
 }
@@ -346,7 +345,7 @@ peerDigestFetchReply(void *data, char *buf, ssize_t size)
        status = reply->sline.status;
        debug(72, 3) ("peerDigestFetchReply: %s status: %d, expires: %d (%+d)\n",
            strBuf(pd->host), status,
-           reply->expires, reply->expires-squid_curtime);
+           reply->expires, reply->expires - squid_curtime);
 
        /* this "if" is based on clientHandleIMSReply() */
        if (status == HTTP_NOT_MODIFIED) {
@@ -509,9 +508,9 @@ static int
 peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const char *step_name)
 {
     PeerDigest *pd = NULL;
-    const char *host = "<unknown>";   /* peer host */
-    const char *reason = NULL; /* reason for completion */
-    const char *no_bug = NULL; /* successful completion if set */
+    const char *host = "<unknown>";    /* peer host */
+    const char *reason = NULL; /* reason for completion */
+    const char *no_bug = NULL; /* successful completion if set */
     const int fcb_valid = cbdataValid(fetch);
     const int pdcb_valid = fcb_valid && cbdataValid(fetch->pd);
     const int pcb_valid = pdcb_valid && cbdataValid(fetch->pd->peer);
@@ -521,7 +520,7 @@ peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const
 
     if (!reason) {
        if (!fcb_valid)
-           reason = "fetch aborted?!"; 
+           reason = "fetch aborted?!";
        else if (!(pd = fetch->pd))
            reason = "peer digest disappeared?!";
        else if (!cbdataValid(pd))
@@ -529,7 +528,6 @@ peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const
        else
            host = strBuf(pd->host);
     }
-
     debug(72, 6) ("%s: peer %s, offset: %d size: %d.\n",
        step_name, host, fcb_valid ? fetch->offset : -1, size);
 
@@ -544,7 +542,6 @@ peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const
        else if (fetch->entry->store_status == STORE_ABORTED)
            reason = "swap aborted";
     }
-
     /* continue checking (maybe-successful eof case) */
     if (!reason && !size) {
        if (!pd->cd)
@@ -556,7 +553,6 @@ peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const
        else
            reason = no_bug = "success";
     }
-
     /* finish if we have a reason */
     if (reason) {
        const int level = strstr(reason, "?!") ? 1 : 3;
@@ -595,7 +591,7 @@ peerDigestFetchAbort(DigestFetchState * fetch, char *buf, const char *reason)
 /* complete the digest transfer, update stats, unlock/release everything */
 static void
 peerDigestReqFinish(DigestFetchState * fetch, char *buf,
-    int fcb_valid, int pdcb_valid, int pcb_valid, 
+    int fcb_valid, int pdcb_valid, int pcb_valid,
     const char *reason, int err)
 {
     assert(reason);
@@ -605,7 +601,6 @@ peerDigestReqFinish(DigestFetchState * fetch, char *buf,
        fetch->pd->flags.requested = 0;
        fetch->pd->req_result = reason;
     }
-
     /* schedule next check if peer is still out there */
     if (pcb_valid) {
        PeerDigest *pd = fetch->pd;
@@ -617,7 +612,6 @@ peerDigestReqFinish(DigestFetchState * fetch, char *buf,
            peerDigestSetCheck(pd, peerDigestNewDelay(fetch->entry));
        }
     }
-
     /* note: order is significant */
     if (fcb_valid)
        peerDigestFetchSetStats(fetch);
@@ -640,8 +634,8 @@ peerDigestPDFinish(DigestFetchState * fetch, int pcb_valid, int err)
 
     pd->times.received = squid_curtime;
     pd->times.req_delay = fetch->resp_time;
-    kb_incr(&pd->stats.sent.kbytes, (size_t)fetch->sent.bytes);
-    kb_incr(&pd->stats.recv.kbytes, (size_t)fetch->recv.bytes);
+    kb_incr(&pd->stats.sent.kbytes, (size_t) fetch->sent.bytes);
+    kb_incr(&pd->stats.recv.kbytes, (size_t) fetch->recv.bytes);
     pd->stats.sent.msgs += fetch->sent.msg;
     pd->stats.recv.msgs += fetch->recv.msg;
 
@@ -654,7 +648,6 @@ peerDigestPDFinish(DigestFetchState * fetch, int pcb_valid, int err)
            cacheDigestDestroy(pd->cd);
            pd->cd = NULL;
        }
-
        pd->flags.usable = 0;
 
        if (!pcb_valid)
@@ -686,7 +679,6 @@ peerDigestFetchFinish(DigestFetchState * fetch, int err)
        storeUnlockObject(fetch->old_entry);
        fetch->old_entry = NULL;
     }
-
     /* update global stats */
     kb_incr(&Counter.cd.kbytes_sent, (size_t) fetch->sent.bytes);
     kb_incr(&Counter.cd.kbytes_recv, (size_t) fetch->recv.bytes);
@@ -727,13 +719,13 @@ peerDigestFetchSetStats(DigestFetchState * fetch)
     debug(72, 3) ("peerDigestFetchFinish: recv %d bytes in %d secs\n",
        fetch->recv.bytes, fetch->resp_time);
     debug(72, 3) ("peerDigestFetchFinish: expires: %d (%+d), lmt: %d (%+d)\n",
-       fetch->expires, fetch->expires-squid_curtime, 
-       fetch->entry->lastmod, fetch->entry->lastmod-squid_curtime);
+       fetch->expires, fetch->expires - squid_curtime,
+       fetch->entry->lastmod, fetch->entry->lastmod - squid_curtime);
 }
 
 
 static int
-peerDigestSetCBlock(PeerDigest *pd, const char *buf)
+peerDigestSetCBlock(PeerDigest * pd, const char *buf)
 {
     StoreDigestCBlock cblock;
     int freed_size = 0;
@@ -788,7 +780,7 @@ peerDigestSetCBlock(PeerDigest *pd, const char *buf)
     /* check size changes */
     if (pd->cd && cblock.mask_size != pd->cd->mask_size) {
        debug(72, 2) ("%s digest changed size: %d -> %d\n",
-          host, cblock.mask_size, pd->cd->mask_size);
+           host, cblock.mask_size, pd->cd->mask_size);
        freed_size = pd->cd->mask_size;
        cacheDigestDestroy(pd->cd);
        pd->cd = NULL;
@@ -808,7 +800,7 @@ peerDigestSetCBlock(PeerDigest *pd, const char *buf)
 }
 
 static int
-peerDigestUseful(const PeerDigest *pd)
+peerDigestUseful(const PeerDigest * pd)
 {
     /* TODO: we should calculate the prob of a false hit instead of bit util */
     const int bit_util = cacheDigestBitUtil(pd->cd);
@@ -823,11 +815,11 @@ peerDigestUseful(const PeerDigest *pd)
 static int
 saneDiff(time_t diff)
 {
-    return abs(diff) > squid_curtime/2 ? 0 : diff;
+    return abs(diff) > squid_curtime / 2 ? 0 : diff;
 }
 
 void
-peerDigestStatsReport(const PeerDigest *pd, StoreEntry * e)
+peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e)
 {
 #define f2s(flag) (pd->flags.flag ? "yes" : "no")
 #define appendTime(tm) storeAppendPrintf(e, "%s\t %10d\t %+d\t %+d\n", \
index 405ac98ec9c289fef750af9d47ef5bf05e4a15e3..a9a1c85a264588b238eb510d626d4c354394eb5a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.291 1998/11/21 16:54:29 wessels Exp $
+ * $Id: protos.h,v 1.292 1998/11/25 09:00:24 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -596,7 +596,7 @@ extern peer *getAnyParent(request_t * request);
 extern lookup_t peerDigestLookup(peer * p, request_t * request, StoreEntry * entry);
 extern peer *neighborsDigestSelect(request_t * request, StoreEntry * entry);
 extern void peerNoteDigestLookup(request_t * request, peer * p, lookup_t lookup);
-extern void peerNoteDigestGone(peer *p);
+extern void peerNoteDigestGone(peer * p);
 extern int neighborUp(const peer * e);
 extern void peerDestroy(peer * e);
 extern char *neighborTypeStr(const peer * e);
@@ -637,10 +637,10 @@ extern peer *peerGetSomeParent(request_t *, hier_code *);
 extern void peerSelectInit(void);
 
 /* peer_digest.c */
-extern PeerDigest *peerDigestCreate(peer *p);
-extern void peerDigestNeeded(PeerDigest *pd);
-extern void peerDigestNotePeerGone(PeerDigest *pd);
-extern void peerDigestStatsReport(const PeerDigest *pd, StoreEntry * e);
+extern PeerDigest *peerDigestCreate(peer * p);
+extern void peerDigestNeeded(PeerDigest * pd);
+extern void peerDigestNotePeerGone(PeerDigest * pd);
+extern void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
 
 /* forward.c */
 extern void fwdStart(int, StoreEntry *, request_t *, struct in_addr);
index 1b163529195752005ec3a45e7a41171a865394bb..58f7669148292c3cb667986599df22d2f6dcdbff 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: snmp_agent.cc,v 1.61 1998/11/18 00:29:27 glenn Exp $
+ * $Id: snmp_agent.cc,v 1.62 1998/11/25 09:00:24 wessels Exp $
  *
  * DEBUG: section 49     SNMP Interface
  * AUTHOR: Kostas Anagnostakis
@@ -420,9 +420,9 @@ snmp_prfProtoFn(variable_list * Var, snint * ErrP)
        case PERF_PROTOSTAT_AGGR_CURSWAP:
            *(Answer->val.integer) = (snint) store_swap_size;
            break;
-        case PERF_PROTOSTAT_AGGR_CLIENTS:
-            *(Answer->val.integer) = (snint) Counter.client_http.clients;
-            break;
+       case PERF_PROTOSTAT_AGGR_CLIENTS:
+           *(Answer->val.integer) = (snint) Counter.client_http.clients;
+           break;
        default:
            *ErrP = SNMP_ERR_NOSUCHNAME;
            snmp_var_free(Answer);
@@ -472,12 +472,12 @@ snmp_prfProtoFn(variable_list * Var, snint * ErrP)
        case PERF_MEDIAN_DNS:
            x = statHistDeltaMedian(&l->dns.svc_time, &f->dns.svc_time);
            break;
-        case PERF_MEDIAN_RHR:
-            x = statRequestHitRatio(minutes);
-            break;
-        case PERF_MEDIAN_BHR:
-            x = statByteHitRatio(minutes);
-            break;
+       case PERF_MEDIAN_RHR:
+           x = statRequestHitRatio(minutes);
+           break;
+       case PERF_MEDIAN_BHR:
+           x = statByteHitRatio(minutes);
+           break;
        default:
            *ErrP = SNMP_ERR_NOSUCHNAME;
            snmp_var_free(Answer);
index 8443442adef54447fc2c97484d189dee7268b212..a8a3b2aa5c9d899388e51947e12b308fd9cf3330 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: snmp_core.cc,v 1.18 1998/11/18 00:16:39 glenn Exp $
+ * $Id: snmp_core.cc,v 1.19 1998/11/25 09:00:25 wessels Exp $
  *
  * DEBUG: section 49    SNMP support
  * AUTHOR: Glenn Chisholm
@@ -63,12 +63,12 @@ snmpUdpData *snmpUdpTail = NULL;
 #ifdef __STDC__
 static mib_tree_entry *snmpAddNode(oid * name, int len, oid_ParseFn * parsefunction, int children,...);
 static oid *snmpCreateOid(int length,...);
-#else 
+#else
 static mib_tree_entry *snmpAddNode();
 static oid *snmpCreateOid();
-#endif 
+#endif
 extern void (*snmplib_debug_hook) (int, char *);
-static void snmpDecodePacket(snmp_request_t * rq); 
+static void snmpDecodePacket(snmp_request_t * rq);
 static void snmpConstructReponse(snmp_request_t * rq, struct snmp_session *Session);
 static struct snmp_pdu *snmpAgentResponse(struct snmp_pdu *PDU);
 static void snmpUdpSend(int, const struct sockaddr_in *, void *, int);
@@ -206,8 +206,8 @@ snmpInit(void)
                                                    LEN_SQ_PRF + 3, snmp_prfProtoFn, 0),
                                                snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, 2, 1, 13),
                                                    LEN_SQ_PRF + 3, snmp_prfProtoFn, 0),
-                                                snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, 2, 1, 14),
-                                                    LEN_SQ_PRF + 3, snmp_prfProtoFn, 0),
+                                               snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, 2, 1, 14),
+                                                   LEN_SQ_PRF + 3, snmp_prfProtoFn, 0),
                                                snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, 2, 1, 15),
                                                    LEN_SQ_PRF + 3, snmp_prfProtoFn, 0)),
                                            snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 2, SQ_PRF, 2, 2),
@@ -218,82 +218,82 @@ snmpInit(void)
                                                        LEN_SQ_PRF + 4, NULL, 3,
                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 1, 1),
                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 1, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 1, 60),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 1, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 1, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 2),
                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 2, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 2, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),  
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 2, 60),  
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 2, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 2, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 2, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 3),
                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 3, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 3, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),  
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 3, 60),  
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 3, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 3, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 3, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 4),
                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 4, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 4, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),  
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 4, 60),  
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 4, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 4, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 4, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 5),
                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 5, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 5, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),  
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 5, 60),  
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 5, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 5, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 5, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 6),
                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 6, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 6, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),  
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 6, 60),  
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 6, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 6, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 6, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 7),
                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 7, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 7, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),  
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 7, 60),  
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
-                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 8),
-                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 8, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 8, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 8, 60),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
-                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 9),
-                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 9, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 9, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 9, 60),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
-                                                    snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 10),
-                                                        LEN_SQ_PRF + 4, NULL, 3,
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 10, 1),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 10, 5),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
-                                                        snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 10, 60),
-                                                            LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)))))),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 7, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 7, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 7, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                   snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 8),
+                                                       LEN_SQ_PRF + 4, NULL, 3,
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 8, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 8, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 8, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                   snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 9),
+                                                       LEN_SQ_PRF + 4, NULL, 3,
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 9, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 9, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 9, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)),
+                                                   snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, 2, 2, 1, 10),
+                                                       LEN_SQ_PRF + 4, NULL, 3,
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 10, 1),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 10, 5),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0),
+                                                       snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 5, SQ_PRF, 2, 2, 1, 10, 60),
+                                                           LEN_SQ_PRF + 5, snmp_prfProtoFn, 0)))))),
                                    snmpAddNode(snmpCreateOid(LEN_SQ_NET, SQ_NET),
                                        LEN_SQ_NET, NULL, 3,
                                        snmpAddNode(snmpCreateOid(LEN_SQ_NET + 1, SQ_NET, 1),
@@ -717,14 +717,14 @@ snmpTreeGet(oid * Current, snint CurrentLen)
 
     mibTreeEntry = mib_tree_head;
     if (Current[count] == mibTreeEntry->name[count]) {
-        count++;
-        while ((mibTreeEntry) && (count < CurrentLen)) {
-            mibTreeEntry = snmpTreeEntry(Current[count], count, mibTreeEntry);
-            count++;
-        }
+       count++;
+       while ((mibTreeEntry) && (count < CurrentLen)) {
+           mibTreeEntry = snmpTreeEntry(Current[count], count, mibTreeEntry);
+           count++;
+       }
     }
     if (mibTreeEntry) {
-        Fn = mibTreeEntry->parsefunction;
+       Fn = mibTreeEntry->parsefunction;
     }
     debug(49, 5) ("snmpTreeGet: return\n");
     return (Fn);
@@ -754,26 +754,26 @@ snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen)
        if ((mibTreeEntry) && (mibTreeEntry->parsefunction)) {
            count--;
            nextoid = snmpTreeSiblingEntry(Current[count], count, mibTreeEntry->parent);
-           if(nextoid){
+           if (nextoid) {
                mibTreeEntry = nextoid;
                count++;
-           }else{
+           } else {
                debug(49, 5) ("snmpTreeNext: Attempting to recurse up for next object\n");
-               while(!nextoid){
+               while (!nextoid) {
                    count--;
                    nextoid = mibTreeEntry->parent;
                    mibTreeEntry = snmpTreeEntry(Current[count] + 1, count, nextoid->parent);
-                   if(!mibTreeEntry){
-                       mibTreeEntry = nextoid; 
+                   if (!mibTreeEntry) {
+                       mibTreeEntry = nextoid;
                        nextoid = NULL;
-                   }
+                   }
                }
            }
        }
        debug(49, 5) ("snmpTreeNext: Past Second\n");
 
        while ((mibTreeEntry) && (!mibTreeEntry->parsefunction)) {
-          mibTreeEntry = mibTreeEntry->leaves[0]; 
+           mibTreeEntry = mibTreeEntry->leaves[0];
        }
     }
     if (mibTreeEntry) {
@@ -790,16 +790,16 @@ snmpTreeSiblingEntry(oid entry, snint len, mib_tree_entry * current)
 {
     mib_tree_entry *next = NULL;
     int count = 0;
-    
+
     while ((!next) && (count < current->children)) {
-        if (current->leaves[count]->name[len] == entry) {
-            next = current->leaves[count];
-        }
-        count++;
+       if (current->leaves[count]->name[len] == entry) {
+           next = current->leaves[count];
+       }
+       count++;
     }
-    if(count < current->children){
+    if (count < current->children) {
        next = current->leaves[count];
-    }else{
+    } else {
        next = NULL;
     }
     return (next);
@@ -950,7 +950,7 @@ snmpAppendUdp(snmpUdpData * item)
 /* 
  * Returns the list of parameters in an oid[]
  */
-#ifdef __STDC__ 
+#ifdef __STDC__
 oid *
 snmpCreateOid(int length,...)
 {
@@ -960,18 +960,18 @@ snmpCreateOid(int length,...)
 
     va_start(args, length);
 #else
-oid *   
+oid *
 snmpCreateOid(va_alist)
      va_dcl
 {
     va_list args;
     int length = 0, loop;
     oid *new_oid;
-    
+
     va_start(args);
     length va_arg(args, int);
 #endif
-    
+
     new_oid = xmalloc(sizeof(oid) * length);
 
     if (length > 0) {
index bddb8199b057c63e3c1fc955df45f946b7f77318..1693b5d4f9a98b0edcbebacc2102fe0ccab7b1aa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: store_digest.cc,v 1.32 1998/11/13 21:02:10 rousskov Exp $
+ * $Id: store_digest.cc,v 1.33 1998/11/25 09:00:26 wessels Exp $
  *
  * DEBUG: section 71    Store Digest Manager
  * AUTHOR: Alex Rousskov
@@ -367,8 +367,8 @@ storeDigestRewriteResume(void)
     httpReplySetHeaders(e->mem_obj->reply, 1.0, 200, "Cache Digest OK",
        "application/cache-digest", store_digest->mask_size + sizeof(sd_state.cblock),
        squid_curtime, squid_curtime + StoreDigestRewritePeriod);
-    debug(71, 3) ("storeDigestRewrite: entry expires on %d (%+d)\n", 
-       e->mem_obj->reply->expires, e->mem_obj->reply->expires-squid_curtime);
+    debug(71, 3) ("storeDigestRewrite: entry expires on %d (%+d)\n",
+       e->mem_obj->reply->expires, e->mem_obj->reply->expires - squid_curtime);
     storeBuffer(e);
     httpReplySwapOut(e->mem_obj->reply, e);
     storeDigestCBlockSwapOut(e);
@@ -384,7 +384,7 @@ storeDigestRewriteFinish(StoreEntry * e)
     storeComplete(e);
     storeTimestampsSet(e);
     debug(71, 2) ("storeDigestRewriteFinish: digest expires at %d (%+d)\n",
-       e->expires, e->expires-squid_curtime);
+       e->expires, e->expires - squid_curtime);
     /* is this the write order? @?@ */
     requestUnlink(e->mem_obj->request);
     e->mem_obj->request = NULL;