From 5942e8d402edd68e768b7c7aa5de25f1d33f9fde Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 16 Sep 1998 01:37:41 +0000 Subject: [PATCH] gindent --- src/HttpHeader.cc | 4 ++-- src/acl.cc | 16 ++++++++-------- src/comm_select.cc | 6 +++--- src/globals.h | 4 ++-- src/icmp.cc | 3 ++- src/icp_v2.cc | 4 ++-- src/main.cc | 6 +++--- src/neighbors.cc | 28 ++++++++++++++-------------- src/net_db.cc | 14 +++++++------- src/peer_digest.cc | 4 ++-- src/protos.h | 6 +++--- src/stat.cc | 4 ++-- src/store.cc | 3 ++- src/store_dir.cc | 32 ++++++++++++++++---------------- src/store_key_md5.cc | 6 +++--- src/store_rebuild.cc | 16 ++++++++-------- src/structs.h | 8 ++++---- src/unlinkd.cc | 4 ++-- 18 files changed, 85 insertions(+), 83 deletions(-) diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index d9b5fddc1a..7c0f4395e9 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -243,7 +243,7 @@ httpHeaderInitModule() 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; diff --git a/src/acl.cc b/src/acl.cc index 761071dd1d..d3e098c049 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -271,9 +271,9 @@ aclParseIntRange(void *curlist) 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; } @@ -1111,9 +1111,9 @@ aclMatchIntegerRange(intrange * data, int i) 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) { @@ -1698,13 +1698,13 @@ aclDestroyDenyInfoList(acl_deny_info_list ** list) } 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); } } diff --git a/src/comm_select.cc b/src/comm_select.cc index 572b588f88..19316c07ef 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,7 +1,7 @@ /* - * $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 * @@ -218,7 +218,7 @@ comm_poll_icp_incoming(void) 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) @@ -245,7 +245,7 @@ comm_poll_http_incoming(void) 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) diff --git a/src/globals.h b/src/globals.h index 898c186294..18b80fac26 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $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/ @@ -142,4 +142,4 @@ extern time_t delay_pools_last_update; /* 0 */ 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 */ diff --git a/src/icmp.cc b/src/icmp.cc index 749b965f2d..15e75a42fa 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -132,6 +132,7 @@ icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf) /* call neighborsUdpAck even if ping_status != PING_WAITING */ neighborsUdpAck(key, &header, from); } + #endif /* USE_ICMP */ void diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 9b8c34c43c..793d7c3475 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -537,7 +537,7 @@ icpCount(void *buf, int which, size_t len, int delay) 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) diff --git a/src/main.cc b/src/main.cc index f153f27947..bb328f5e41 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -329,7 +329,7 @@ mainReconfigure(void) 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"); @@ -447,7 +447,7 @@ mainInitialize(void) } 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"); diff --git a/src/neighbors.cc b/src/neighbors.cc index 11d09381fc..5f1b2612a9 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -752,7 +752,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka 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); @@ -1040,7 +1040,7 @@ peerCountMcastPeersDone(void *data) } 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; @@ -1147,16 +1147,16 @@ dump_peers(StoreEntry * sentry, peer * peers) 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", @@ -1165,8 +1165,8 @@ dump_peers(StoreEntry * sentry, peer * peers) 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"); } diff --git a/src/net_db.cc b/src/net_db.cc index 65cb05f72f..c844275eda 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -794,12 +794,12 @@ void 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 } diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 319b1b19a7..19ea7a22c1 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -528,7 +528,7 @@ peerDigestFetchFinish(DigestFetchState * fetch, char *buf, const char *err_msg) 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; diff --git a/src/protos.h b/src/protos.h index 9291c50455..9181892365 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $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/ @@ -491,8 +491,8 @@ extern int icpCheckUdpHit(StoreEntry *, request_t * request); 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, diff --git a/src/stat.cc b/src/stat.cc index 617b0f6ac7..9c4be351a2 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -745,7 +745,7 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) 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); diff --git a/src/store.cc b/src/store.cc index 0eeb1a36b0..c439f4fdc6 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -569,6 +569,7 @@ storePPNR(StoreEntry * e) assert(e->flags.entry_fwd_hdr_wait); e->flags.entry_fwd_hdr_wait = 0; } + #endif /* PPNR_WIP */ /* diff --git a/src/store_dir.cc b/src/store_dir.cc index c499c41454..889f37d09f 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -799,20 +799,20 @@ storeDirConfigure(void) 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 */ } } @@ -823,6 +823,6 @@ storeDirDiskFull(int fn) 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); } diff --git a/src/store_key_md5.cc b/src/store_key_md5.cc index d2e11e59e1..f1e55355ca 100644 --- a/src/store_key_md5.cc +++ b/src/store_key_md5.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -128,7 +128,7 @@ storeKeyDup(const cache_key * key) } 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; @@ -137,7 +137,7 @@ storeKeyCopy(cache_key * dst, const cache_key *src) void storeKeyFree(const cache_key * key) { - memFree(MEM_MD5_DIGEST, (void *)key); + memFree(MEM_MD5_DIGEST, (void *) key); } int diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index 5b8a036107..56bf7aaf90 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -315,15 +315,15 @@ storeRebuildFromSwapLog(rebuild_dir * d) } 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) { diff --git a/src/structs.h b/src/structs.h index d72fa06cbf..c105fe02ef 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $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/ @@ -1233,7 +1233,7 @@ struct _store_flags { 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; @@ -1242,7 +1242,7 @@ struct _store_flags { 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; @@ -1259,7 +1259,7 @@ struct _store_flags { unsigned short entry_negcached:1; unsigned short entry_validated:1; unsigned short entry_bad_length:1; -#endif /* ENDIAN */ +#endif /* ENDIAN */ }; struct _StoreEntry { diff --git a/src/unlinkd.cc b/src/unlinkd.cc index f3e257f565..f8fc97bdab 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,5 +1,5 @@ /* - * $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 @@ -117,7 +117,7 @@ unlinkdClose(void) 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 -- 2.47.3