/*
- * $Id: StatHist.cc,v 1.17 1998/10/16 19:20:17 wessels Exp $
+ * $Id: StatHist.cc,v 1.18 1998/10/19 22:36:56 wessels Exp $
*
* DEBUG: section 62 Generic Histogram
* AUTHOR: Duane Wessels
#include "squid.h"
/* Local functions */
-static void statHistInit(StatHist * H, int capacity, hbase_f *val_in, hbase_f *val_out, double min, double max);
+static void statHistInit(StatHist * H, int capacity, hbase_f * val_in, hbase_f * val_out, double min, double max);
static int statHistBin(const StatHist * H, double v);
static double statHistVal(const StatHist * H, int bin);
static StatHistBinDumper statHistBinDumper;
/* low level init, higher level functions has less params */
static void
-statHistInit(StatHist * H, int capacity, hbase_f *val_in, hbase_f *val_out, double min, double max)
+statHistInit(StatHist * H, int capacity, hbase_f * val_in, hbase_f * val_out, double min, double max)
{
assert(H);
assert(capacity > 0);
{
assert(Dest);
assert(Orig);
- debug(62,3)("statHistCopy: Dest=%p, Orig=%p\n", Dest, Orig);
+ debug(62, 3) ("statHistCopy: Dest=%p, Orig=%p\n", Dest, Orig);
assert(Dest->bins);
/* better be safe than sorry */
- debug(62,3)("statHistCopy: capacity %d %d\n",
+ debug(62, 3) ("statHistCopy: capacity %d %d\n",
Dest->capacity, Orig->capacity);
assert(Dest->capacity == Orig->capacity);
- debug(62,3)("statHistCopy: min %f %f\n", Dest->min, Orig->min);
+ debug(62, 3) ("statHistCopy: min %f %f\n", Dest->min, Orig->min);
assert(Dest->min == Orig->min);
- debug(62,3)("statHistCopy: max %f %f\n", Dest->max, Orig->max);
+ debug(62, 3) ("statHistCopy: max %f %f\n", Dest->max, Orig->max);
assert(Dest->max == Orig->max);
- debug(62,3)("statHistCopy: scale %f %f\n", Dest->scale, Orig->scale);
+ debug(62, 3) ("statHistCopy: scale %f %f\n", Dest->scale, Orig->scale);
assert(Dest->scale == Orig->scale);
assert(Dest->val_in == Orig->val_in);
assert(Dest->val_out == Orig->val_out);
/* actual copy */
- debug(62,3)("statHistCopy: copying %d bytes to %p from %p\n",
+ debug(62, 3) ("statHistCopy: copying %d bytes to %p from %p\n",
Dest->capacity * sizeof(*Dest->bins),
Dest->bins,
Orig->bins);
/*
- * $Id: authenticate.cc,v 1.7 1998/10/19 17:48:26 wessels Exp $
+ * $Id: authenticate.cc,v 1.8 1998/10/19 22:36:57 wessels Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Duane Wessels
if (!Config.Program.authenticate)
return;
if (authenticators == NULL)
- authenticators = helperCreate("authenticator");
+ authenticators = helperCreate("authenticator");
authenticators->cmdline = Config.Program.authenticate;
authenticators->n_to_start = Config.authenticateChildren;
authenticators->ipc_type = IPC_TCP_SOCKET;
+
/*
- * $Id: client.cc,v 1.76 1998/09/29 16:33:41 wessels Exp $
+ * $Id: client.cc,v 1.77 1998/10/19 22:36:58 wessels Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
/*
- * $Id: comm_select.cc,v 1.20 1998/10/18 23:06:47 wessels Exp $
+ * $Id: comm_select.cc,v 1.21 1998/10/19 22:36:58 wessels Exp $
*
* DEBUG: section 5 Socket Functions
*
/* Found a set bit */
fd = (j * (sizeof(*fdsp) * NBBY)) + k;
#if DEBUG_FDBITS
- debug(5,9)("FD %d bit set for reading\n", fd);
+ debug(5, 9) ("FD %d bit set for reading\n", fd);
assert(FD_ISSET(fd, &readfds));
#endif
if (fdIsIcp(fd)) {
/* Found a set bit */
fd = (j * (sizeof(*fdsp) * NBBY)) + k;
#if DEBUG_FDBITS
- debug(5,9)("FD %d bit set for writing\n", fd);
+ debug(5, 9) ("FD %d bit set for writing\n", fd);
assert(FD_ISSET(fd, &writefds));
#endif
if (fdIsIcp(fd)) {
/*
- * $Id: dns.cc,v 1.70 1998/10/19 17:48:26 wessels Exp $
+ * $Id: dns.cc,v 1.71 1998/10/19 22:36:59 wessels Exp $
*
* DEBUG: section 34 Dnsserver interface
* AUTHOR: Harvest Derived
if (!Config.Program.dnsserver)
return;
if (dnsservers == NULL)
- dnsservers = helperCreate("dnsserver");
+ dnsservers = helperCreate("dnsserver");
dnsservers->n_to_start = Config.dnsChildren;
dnsservers->ipc_type = IPC_TCP_SOCKET;
assert(dnsservers->cmdline == NULL);
helper_request *r = xcalloc(1, sizeof(*r));
helper_server *srv;
if (hlp == NULL) {
- debug(29,3)("helperSubmit: hlp == NULL\n");
+ debug(29, 3) ("helperSubmit: hlp == NULL\n");
callback(data, NULL);
return;
}
/*
- * $Id: http.cc,v 1.330 1998/10/18 09:05:43 wessels Exp $
+ * $Id: http.cc,v 1.331 1998/10/19 22:37:01 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
int skew = abs(reply->date - squid_curtime);
if (skew > 86400)
debug(11, 3) ("%s's clock is skewed by %d seconds!\n",
- httpState->request->host, skew);
+ httpState->request->host, skew);
}
}
}
/*
- * $Id: redirect.cc,v 1.74 1998/10/19 17:48:28 wessels Exp $
+ * $Id: redirect.cc,v 1.75 1998/10/19 22:37:02 wessels Exp $
*
* DEBUG: section 29 Redirector
* AUTHOR: Duane Wessels
if (!Config.Program.redirect)
return;
if (redirectors == NULL)
- redirectors = helperCreate("redirector");
+ redirectors = helperCreate("redirector");
wordlistAdd(&redirectors->cmdline, Config.Program.redirect);
redirectors->n_to_start = Config.redirectChildren;
redirectors->ipc_type = IPC_TCP_SOCKET;
/*
- * $Id: refresh.cc,v 1.42 1998/10/18 21:19:03 rousskov Exp $
+ * $Id: refresh.cc,v 1.43 1998/10/19 22:37:02 wessels Exp $
*
* DEBUG: section 22 Refresh Calculation
* AUTHOR: Harvest Derived
#include "squid.h"
-typedef enum { rcHTTP, rcICP, rcCDigest, rcCount } refreshCountsEnum;
+typedef enum {
+ rcHTTP, rcICP, rcCDigest, rcCount
+} refreshCountsEnum;
static struct RefreshCounts {
const char *proto;
time_t check_time = squid_curtime + delta;
if (entry->mem_obj)
uri = entry->mem_obj->url;
- else
- if (request)
+ else if (request)
uri = urlCanonical(request);
-
+
debug(22, 3) ("refreshCheck(%s): '%s'\n", rc->proto, uri ? uri : "<none>");
rc->total++;
if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE)) {
debug(22, 3) ("refreshCheck: MAYBE: last-modified in the future\n");
rc->response_lmt_future_maybe++;
}
-
if (age <= min) {
debug(22, 3) ("refreshCheck: NO: age <= min\n");
rc->conf_min_age_fresh++;
* refreshCheck() function above */
int
-refreshCheckHTTP(const StoreEntry * entry, request_t * request) {
+refreshCheckHTTP(const StoreEntry * entry, request_t * request)
+{
return refreshCheck(entry, request, 0, &refreshCounts[rcHTTP]);
}
int
-refreshCheckICP(const StoreEntry * entry, request_t * request) {
+refreshCheckICP(const StoreEntry * entry, request_t * request)
+{
return refreshCheck(entry, request, 30, &refreshCounts[rcICP]);
}
int
-refreshCheckDigest(const StoreEntry * entry, time_t delta) {
+refreshCheckDigest(const StoreEntry * entry, time_t delta)
+{
return refreshCheck(entry, NULL, delta, &refreshCounts[rcCDigest]);
}
refreshCountsStatsEntry(response_lmt_now_stale);
refreshCountsStatsEntry(conf_min_age_fresh);
refreshCountsStatsEntry(default_stale);
- tot = sum; /* paranoid: "total" line shows 100% if we forgot nothing */
+ tot = sum; /* paranoid: "total" line shows 100% if we forgot nothing */
refreshCountsStatsEntry(total);
/* maybe counters */
refreshCountsStatsEntry(request_reload_ignore_maybe);
for (i = 0; i < rcCount; ++i)
storeAppendPrintf(sentry, "%10s\t%6d\t%6.2f\n",
refreshCounts[i].proto,
- refreshCounts[i].total,
+ refreshCounts[i].total,
xpercent(refreshCounts[i].total, total));
/* per protocol histograms */
/*
- * $Id: stat.cc,v 1.296 1998/10/08 03:17:30 wessels Exp $
+ * $Id: stat.cc,v 1.297 1998/10/19 22:37:03 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
s = CountHist[0].server.all.kbytes_in.kb - CountHist[minutes].server.all.kbytes_in.kb;
/* size_t might be unsigned */
if (c > s)
- return dpercent(c - s, c);
+ return dpercent(c - s, c);
else
- return (-1.0 * dpercent(s - c, c));
+ return (-1.0 * dpercent(s - c, c));
}
#if STAT_GRAPHS
/*
- * $Id: store_digest.cc,v 1.29 1998/10/17 04:34:12 rousskov Exp $
+ * $Id: store_digest.cc,v 1.30 1998/10/19 22:37:04 wessels Exp $
*
* DEBUG: section 71 Store Digest Manager
* AUTHOR: Alex Rousskov
/* if expires too soon, ignore */
/* Note: We should use the time of the next rebuild, not (cur_time+period) */
if (refreshCheckDigest(entry, StoreDigestRebuildPeriod)) {
- debug(71, 6) ("storeDigestAdd: entry expires within %d secs, ignoring\n",
+ debug(71, 6) ("storeDigestAdd: entry expires within %d secs, ignoring\n",
StoreDigestRebuildPeriod);
} else {
good_entry = 1;
+
/*
- * $Id: structs.h,v 1.244 1998/10/19 17:48:29 wessels Exp $
+ * $Id: structs.h,v 1.245 1998/10/19 22:37:05 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/