/*
- * $Id: HttpHeader.cc,v 1.54 1998/08/26 05:36:42 wessels Exp $
+ * $Id: HttpHeader.cc,v 1.55 1998/09/15 19:37:41 wessels Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
httpHeaderCalcMask(&RequestHeadersMask, (const int *) GeneralHeadersArr, countof(GeneralHeadersArr));
httpHeaderCalcMask(&RequestHeadersMask, (const int *) EntityHeadersArr, countof(EntityHeadersArr));
/* init header stats */
- assert(HttpHeaderStatCount == hoReply+1);
+ assert(HttpHeaderStatCount == hoReply + 1);
for (i = 0; i < HttpHeaderStatCount; i++)
httpHeaderStatInit(HttpHeaderStats + i, HttpHeaderStats[i].label);
HttpHeaderStats[hoRequest].owner_mask = &RequestHeadersMask;
/*
- * $Id: acl.cc,v 1.182 1998/09/14 22:27:57 wessels Exp $
+ * $Id: acl.cc,v 1.183 1998/09/15 19:37:43 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
q->i = atoi(t);
t = strchr(t, '-');
if (t && *(++t))
- q->j = atoi(t);
+ q->j = atoi(t);
else
- q->j = q->i;
+ q->j = q->i;
*(Tail) = q;
Tail = &q->next;
}
prev = NULL;
while (data) {
if (i < data->i) {
- (void) 0;
+ (void) 0;
} else if (i > data->j) {
- (void) 0;
+ (void) 0;
} else {
/* matched */
if (prev != NULL) {
}
static void
-aclDestroyIntRange(intrange *list)
+aclDestroyIntRange(intrange * list)
{
intrange *w = NULL;
intrange *n = NULL;
for (w = list; w; w = n) {
- n = w->next;
- safe_free(w);
+ n = w->next;
+ safe_free(w);
}
}
/*
- * $Id: comm_select.cc,v 1.10 1998/09/15 06:25:17 wessels Exp $
+ * $Id: comm_select.cc,v 1.11 1998/09/15 19:37:46 wessels Exp $
*
* DEBUG: section 5 Socket Functions
*
nevents = comm_check_incoming_poll_handlers(nfds, fds);
incoming_icp_interval += Config.comm_incoming.icp_average - nevents;
if (incoming_icp_interval < Config.comm_incoming.icp_min_poll)
- incoming_icp_interval = Config.comm_incoming.icp_min_poll;
+ incoming_icp_interval = Config.comm_incoming.icp_min_poll;
if (incoming_icp_interval > MAX_INCOMING_INTERVAL)
incoming_icp_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_ICP_MAX)
incoming_http_interval = incoming_http_interval
+ Config.comm_incoming.http_average - nevents;
if (incoming_http_interval < Config.comm_incoming.http_min_poll)
- incoming_http_interval = Config.comm_incoming.http_min_poll;
+ incoming_http_interval = Config.comm_incoming.http_min_poll;
if (incoming_http_interval > MAX_INCOMING_INTERVAL)
incoming_http_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_HTTP_MAX)
/*
- * $Id: globals.h,v 1.67 1998/09/09 20:05:49 wessels Exp $
+ * $Id: globals.h,v 1.68 1998/09/15 19:37:47 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern int refresh_nocache_hack; /* 0 */
#endif
extern request_flags null_request_flags;
-extern int open_disk_fd; /* 0 */
+extern int open_disk_fd; /* 0 */
/*
- * $Id: icmp.cc,v 1.64 1998/09/11 17:07:43 wessels Exp $
+ * $Id: icmp.cc,v 1.65 1998/09/15 19:37:49 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
/* call neighborsUdpAck even if ping_status != PING_WAITING */
neighborsUdpAck(key, &header, from);
}
+
#endif /* USE_ICMP */
void
/*
- * $Id: icp_v2.cc,v 1.51 1998/09/11 17:07:43 wessels Exp $
+ * $Id: icp_v2.cc,v 1.52 1998/09/15 19:37:49 wessels Exp $
*
* DEBUG: section 12 Internet Cache Protocol
* AUTHOR: Duane Wessels
static cache_key queried_keys[N_QUERIED_KEYS][MD5_DIGEST_CHARS];
int
-icpSetCacheKey(const cache_key *key)
+icpSetCacheKey(const cache_key * key)
{
static int reqnum = 0;
if (++reqnum < 0)
/*
- * $Id: main.cc,v 1.271 1998/09/15 06:34:55 wessels Exp $
+ * $Id: main.cc,v 1.272 1998/09/15 19:37:51 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
authenticateOpenServers();
serverConnectionsOpen();
if (theOutIcpConnection >= 0) {
- if (!Config2.Accel.on || Config.onoff.accel_with_proxy)
+ if (!Config2.Accel.on || Config.onoff.accel_with_proxy)
neighbors_open(theOutIcpConnection);
else
debug(1, 1) ("ICP port disabled in httpd_accelerator mode\n");
}
serverConnectionsOpen();
if (theOutIcpConnection >= 0) {
- if (!Config2.Accel.on || Config.onoff.accel_with_proxy)
+ if (!Config2.Accel.on || Config.onoff.accel_with_proxy)
neighbors_open(theOutIcpConnection);
else
debug(1, 1) ("ICP port disabled in httpd_accelerator mode\n");
/*
- * $Id: neighbors.cc,v 1.248 1998/09/14 22:17:59 wessels Exp $
+ * $Id: neighbors.cc,v 1.249 1998/09/15 19:37:52 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
opcode_d, storeKeyText(key), p ? p->host : "source");
if (p) {
ntype = neighborType(p, mem->request);
- neighborUpdateRtt(p, mem);
+ neighborUpdateRtt(p, mem);
}
if (ignoreMulticastReply(p, mem)) {
neighborCountIgnored(p);
}
static void
-peerCountHandleIcpReply(peer * p, peer_t type, protocol_t proto, void * hdrnotused, void *data)
+peerCountHandleIcpReply(peer * p, peer_t type, protocol_t proto, void *hdrnotused, void *data)
{
ps_state *psstate = data;
StoreEntry *fake = psstate->entry;
percent(e->htcp.counts[1], e->stats.pings_acked));
} else {
#endif
- for (op = ICP_INVALID; op < ICP_END; op++) {
- if (e->icp.counts[op] == 0)
- continue;
- storeAppendPrintf(sentry, " %12.12s : %8d %3d%%\n",
- icp_opcode_str[op],
- e->icp.counts[op],
- percent(e->icp.counts[op], e->stats.pings_acked));
- }
+ for (op = ICP_INVALID; op < ICP_END; op++) {
+ if (e->icp.counts[op] == 0)
+ continue;
+ storeAppendPrintf(sentry, " %12.12s : %8d %3d%%\n",
+ icp_opcode_str[op],
+ e->icp.counts[op],
+ percent(e->icp.counts[op], e->stats.pings_acked));
+ }
#if USE_HTCP
-}
+ }
#endif
if (e->last_fail_time) {
storeAppendPrintf(sentry, "Last failed connect() at: %s\n",
if (e->pinglist != NULL) {
storeAppendPrintf(sentry, "DOMAIN LIST: ");
for (d = e->pinglist; d; d = d->next) {
- storeAppendPrintf(sentry, "%s%s ",
- d->do_ping ? null_string : "!", d->domain);
+ storeAppendPrintf(sentry, "%s%s ",
+ d->do_ping ? null_string : "!", d->domain);
}
storeAppendPrintf(sentry, "\n");
}
/*
- * $Id: net_db.cc,v 1.126 1998/09/01 23:31:24 wessels Exp $
+ * $Id: net_db.cc,v 1.127 1998/09/15 19:37:54 wessels Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
netdbHostData(const char *host, int *samp, int *rtt, int *hops)
{
#if USE_ICMP
- netdbEntry *n = netdbLookupHost(host);
- if (n == NULL)
- return;
- *samp = n->pings_recv;
- *rtt = (int) (n->rtt + 0.5);
- *hops = (int) (n->hops + 0.5);
+ netdbEntry *n = netdbLookupHost(host);
+ if (n == NULL)
+ return;
+ *samp = n->pings_recv;
+ *rtt = (int) (n->rtt + 0.5);
+ *hops = (int) (n->hops + 0.5);
#endif
}
/*
- * $Id: peer_digest.cc,v 1.51 1998/09/14 23:42:07 wessels Exp $
+ * $Id: peer_digest.cc,v 1.52 1998/09/15 19:37:55 wessels Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
if (err_msg) {
if (cbdataValid(peer))
debug(72, 1) ("disabling corrupted (%s) digest from %s\n",
- err_msg, peer->host);
+ err_msg, peer->host);
if (peer->digest.cd) {
cacheDigestDestroy(peer->digest.cd);
peer->digest.cd = NULL;
/*
- * $Id: protos.h,v 1.266 1998/09/15 06:34:56 wessels Exp $
+ * $Id: protos.h,v 1.267 1998/09/15 19:37:56 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern void icpConnectionsOpen(void);
extern void icpConnectionShutdown(void);
extern void icpConnectionClose(void);
-extern int icpSetCacheKey(const cache_key *key);
-extern const cache_key * icpGetCacheKey(const char *url, int reqnum);
+extern int icpSetCacheKey(const cache_key * key);
+extern const cache_key *icpGetCacheKey(const char *url, int reqnum);
extern void ipcache_nbgethostbyname(const char *name,
IPH * handler,
/*
- * $Id: stat.cc,v 1.288 1998/09/14 22:18:01 wessels Exp $
+ * $Id: stat.cc,v 1.289 1998/09/15 19:37:58 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, "select_fds = %f/sec\n",
XAVG(select_fds));
storeAppendPrintf(sentry, "average_select_fd_period = %f/fd\n",
- f->select_fds > l->select_fds ?
+ f->select_fds > l->select_fds ?
(f->select_time - l->select_time) / (f->select_fds - l->select_fds)
: 0.0);
x = statHistDeltaMedian(&l->select_fds_hist, &f->select_fds_hist);
/*
- * $Id: store.cc,v 1.459 1998/09/15 04:23:39 wessels Exp $
+ * $Id: store.cc,v 1.460 1998/09/15 19:38:00 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
assert(e->flags.entry_fwd_hdr_wait);
e->flags.entry_fwd_hdr_wait = 0;
}
+
#endif /* PPNR_WIP */
/*
/*
- * $Id: store_dir.cc,v 1.76 1998/09/14 21:28:14 wessels Exp $
+ * $Id: store_dir.cc,v 1.77 1998/09/15 19:38:02 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
fileMap *fm;
Config.Swap.maxSize = 0;
for (i = 0; i < Config.cacheSwap.n_configured; i++) {
- SD = &Config.cacheSwap.swapDirs[i];;
- Config.Swap.maxSize += SD->max_size;
- n = 2 * SD->max_size / Config.Store.avgObjectSize;
- if (NULL == SD->map) {
- /* first time */
- SD->map = file_map_create(n);
- } else if (n > SD->map->max_n_files) {
- /* it grew, need to expand */
- fm = file_map_create(n);
- filemapCopy(SD->map, fm);
- filemapFreeMemory(SD->map);
- SD->map = fm;
- }
- /* else it shrunk, and we leave the old one in place */
+ SD = &Config.cacheSwap.swapDirs[i];;
+ Config.Swap.maxSize += SD->max_size;
+ n = 2 * SD->max_size / Config.Store.avgObjectSize;
+ if (NULL == SD->map) {
+ /* first time */
+ SD->map = file_map_create(n);
+ } else if (n > SD->map->max_n_files) {
+ /* it grew, need to expand */
+ fm = file_map_create(n);
+ filemapCopy(SD->map, fm);
+ filemapFreeMemory(SD->map);
+ SD->map = fm;
+ }
+ /* else it shrunk, and we leave the old one in place */
}
}
SwapDir *SD = &Config.cacheSwap.swapDirs[dirn];
assert(0 <= dirn && dirn < Config.cacheSwap.n_configured);
SD->max_size = SD->cur_size;
- debug(20, 1)("WARNING: Shrinking cache_dir #%d to %d KB\n",
+ debug(20, 1) ("WARNING: Shrinking cache_dir #%d to %d KB\n",
dirn, SD->cur_size);
}
/*
- * $Id: store_key_md5.cc,v 1.15 1998/09/11 17:07:50 wessels Exp $
+ * $Id: store_key_md5.cc,v 1.16 1998/09/15 19:38:02 wessels Exp $
*
* DEBUG: section 20 Storage Manager MD5 Cache Keys
* AUTHOR: Duane Wessels
}
cache_key *
-storeKeyCopy(cache_key * dst, const cache_key *src)
+storeKeyCopy(cache_key * dst, const cache_key * src)
{
xmemcpy(dst, src, MD5_DIGEST_CHARS);
return dst;
void
storeKeyFree(const cache_key * key)
{
- memFree(MEM_MD5_DIGEST, (void *)key);
+ memFree(MEM_MD5_DIGEST, (void *) key);
}
int
/*
- * $Id: store_rebuild.cc,v 1.49 1998/09/14 23:42:37 wessels Exp $
+ * $Id: store_rebuild.cc,v 1.50 1998/09/15 19:38:03 wessels Exp $
*
* DEBUG: section 20 Store Rebuild Routines
* AUTHOR: Duane Wessels
} else if (used && e && e->swap_file_number == s.swap_file_number) {
/* swapfile taken, same URL, newer, update meta */
if (e->store_status == STORE_OK) {
- e->lastref = s.timestamp;
- e->timestamp = s.timestamp;
- e->expires = s.expires;
- e->lastmod = s.lastmod;
- e->flags = s.flags;
- e->refcount += s.refcount;
+ e->lastref = s.timestamp;
+ e->timestamp = s.timestamp;
+ e->expires = s.expires;
+ e->lastmod = s.lastmod;
+ e->flags = s.flags;
+ e->refcount += s.refcount;
} else {
debug_trap("storeRebuildFromSwapLog: bad condition");
- debug(20,1)("\tSee %s:%d\n", __FILE__, __LINE__);
+ debug(20, 1) ("\tSee %s:%d\n", __FILE__, __LINE__);
}
continue;
} else if (used) {
/*
- * $Id: structs.h,v 1.229 1998/09/15 06:35:24 wessels Exp $
+ * $Id: structs.h,v 1.230 1998/09/15 19:38:04 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
unsigned short entry_unused_08:1;
#else
unsigned short entry_fwd_hdr_wait:1;
-#endif /* PPNR_WIP */
+#endif /* PPNR_WIP */
unsigned short key_private:1;
unsigned short entry_dispatched:1;
unsigned short entry_cachable:1;
unsigned short delay_sending:1;
unsigned short entry_revalidate:1;
unsigned short entry_special:1;
-#else /* ENDIAN */
+#else /* ENDIAN */
unsigned short entry_special:1;
unsigned short entry_revalidate:1;
unsigned short delay_sending:1;
unsigned short entry_negcached:1;
unsigned short entry_validated:1;
unsigned short entry_bad_length:1;
-#endif /* ENDIAN */
+#endif /* ENDIAN */
};
struct _StoreEntry {
/*
- * $Id: unlinkd.cc,v 1.27 1998/09/10 19:56:28 wessels Exp $
+ * $Id: unlinkd.cc,v 1.28 1998/09/15 19:38:06 wessels Exp $
*
* DEBUG: section 12 Unlink Daemon
* AUTHOR: Duane Wessels
debug(12, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd);
file_close(unlinkd_wfd);
if (unlinkd_wfd != unlinkd_rfd)
- file_close(unlinkd_rfd);
+ file_close(unlinkd_rfd);
unlinkd_wfd = -1;
unlinkd_rfd = -1;
#endif