From: wessels <> Date: Fri, 7 Feb 1997 11:57:10 +0000 (+0000) Subject: gindent X-Git-Tag: SQUID_3_0_PRE1~5120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c77d85359989904d7321d0182f39a5529b38450;p=thirdparty%2Fsquid.git gindent --- diff --git a/src/client_side.cc b/src/client_side.cc index fb476207a1..8b20b7164b 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.87 1997/02/04 19:10:15 wessels Exp $ + * $Id: client_side.cc,v 1.88 1997/02/07 04:57:10 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -617,7 +617,7 @@ clientPurgeRequest(icpStateData * icpState) LOCAL_ARRAY(char, msg, 8192); LOCAL_ARRAY(char, line, 256); StoreEntry *entry; -debug(0,0,"Config.Options.enable_purge = %d\n", Config.Options.enable_purge); + debug(0, 0, "Config.Options.enable_purge = %d\n", Config.Options.enable_purge); if (!Config.Options.enable_purge) { buf = access_denied_msg(icpState->http_code = 401, icpState->method, diff --git a/src/comm.cc b/src/comm.cc index 024075aecc..32d52df850 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.134 1997/02/07 04:55:56 wessels Exp $ + * $Id: comm.cc,v 1.135 1997/02/07 04:57:12 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1139,7 +1139,7 @@ comm_set_mcast_ttl(int fd, int mcast_ttl) #ifdef IP_MULTICAST_TTL char ttl = (char) mcast_ttl; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 1) < 0) - debug(50, 1, "comm_set_mcast_ttl: FD %d, TTL: %d: %s\n", + debug(50, 1, "comm_set_mcast_ttl: FD %d, TTL: %d: %s\n", fd, mcast_ttl, xstrerror()); #endif return 0; diff --git a/src/disk.cc b/src/disk.cc index 776ead115c..338fc4f193 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.53 1997/02/05 04:54:44 wessels Exp $ + * $Id: disk.cc,v 1.54 1997/02/07 04:57:12 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -245,41 +245,41 @@ diskHandleWrite(int fd, FileEntry * entry) if (len < 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) break; - /* disk i/o failure--flushing all outstanding writes */ - debug(50, 1, "diskHandleWrite: FD %d: disk write error: %s\n", - fd, xstrerror()); - entry->write_daemon = NOT_PRESENT; - entry->write_pending = NO_WRT_PENDING; - /* call finish handler */ - do { + /* disk i/o failure--flushing all outstanding writes */ + debug(50, 1, "diskHandleWrite: FD %d: disk write error: %s\n", + fd, xstrerror()); + entry->write_daemon = NOT_PRESENT; + entry->write_pending = NO_WRT_PENDING; + /* call finish handler */ + do { entry->write_q = r->next; if (r->free) (r->free) (r->buf); safe_free(r); - } while (entry->write_q); - if (entry->wrt_handle) { - entry->wrt_handle(fd, - errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR, + } while (entry->write_q); + if (entry->wrt_handle) { + entry->wrt_handle(fd, + errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR, rlen, - entry->wrt_handle_data); - } - return DISK_ERROR; + entry->wrt_handle_data); } + return DISK_ERROR; + } rlen += len; r->cur_offset += len; if (r->cur_offset < r->len) continue; /* partial write? */ - /* complete write */ + /* complete write */ entry->write_q = r->next; if (r->free) (r->free) (r->buf); safe_free(r); } if (entry->write_q == NULL) { - /* no more data */ + /* no more data */ entry->write_q_tail = NULL; - entry->write_pending = NO_WRT_PENDING; - entry->write_daemon = NOT_PRESENT; + entry->write_pending = NO_WRT_PENDING; + entry->write_daemon = NOT_PRESENT; } else { commSetSelect(fd, COMM_SELECT_WRITE, @@ -414,7 +414,7 @@ file_read(int fd, char *buf, int req_len, int offset, FILE_READ_HD handler, void { dread_ctrl *ctrl_dat; if (fd < 0) - fatal_dump("file_read: bad FD"); + fatal_dump("file_read: bad FD"); ctrl_dat = xcalloc(1, sizeof(dread_ctrl)); ctrl_dat->fd = fd; ctrl_dat->offset = offset; diff --git a/src/dns.cc b/src/dns.cc index 4f7bdfbe01..99184be85a 100644 --- a/src/dns.cc +++ b/src/dns.cc @@ -1,5 +1,5 @@ /* - * $Id: dns.cc,v 1.29 1997/02/06 18:02:10 wessels Exp $ + * $Id: dns.cc,v 1.30 1997/02/07 04:57:13 wessels Exp $ * * DEBUG: section 34 Dnsserver interface * AUTHOR: Harvest Derived @@ -200,9 +200,9 @@ dnsOpenServer(const char *command) close(fd); close(cfd); if (Config.Options.res_defnames) - execlp(command, "(dnsserver)", "-D", NULL); + execlp(command, "(dnsserver)", "-D", NULL); else - execlp(command, "(dnsserver)", NULL); + execlp(command, "(dnsserver)", NULL); debug(50, 0, "dnsOpenServer: %s: %s\n", command, xstrerror()); _exit(1); return 0; diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 02d52131a4..15cc785dd2 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.44 1997/02/04 23:18:16 wessels Exp $ + * $Id: fqdncache.cc,v 1.45 1997/02/07 04:57:13 wessels Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -658,7 +658,7 @@ fqdncache_dnsDispatch(dnsserver_t * dns, fqdncache_entry * f) { char *buf = NULL; if (!BIT_TEST(dns->flags, DNS_FLAG_ALIVE)) - debug_trap("Dispatching a dead DNS server"); + debug_trap("Dispatching a dead DNS server"); if (!fqdncacheHasPending(f)) { debug(35, 0, "fqdncache_dnsDispatch: skipping '%s' because no handler.\n", f->name); diff --git a/src/main.cc b/src/main.cc index d3520fc8d1..715e2864cb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.134 1997/02/06 19:01:46 wessels Exp $ + * $Id: main.cc,v 1.135 1997/02/07 04:57:14 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -528,13 +528,12 @@ mainInitialize(void) leave_suid(); /* Run as non privilegied user */ if (geteuid() == 0) { - debug(0,0,"Squid is not safe to run as root! If you must\n"); - debug(0,0,"start Squid as root, then you must configure\n"); - debug(0,0,"it to run as a non-priveledged user with the\n"); - debug(0,0,"'cache_effective_user' option in the config file.\n"); + debug(0, 0, "Squid is not safe to run as root! If you must\n"); + debug(0, 0, "start Squid as root, then you must configure\n"); + debug(0, 0, "it to run as a non-priveledged user with the\n"); + debug(0, 0, "'cache_effective_user' option in the config file.\n"); fatal("Don't run Squid as root, set 'cache_effective_user'!"); } - if (httpPortNumOverride != 1) Config.Port.http = (u_short) httpPortNumOverride; if (icpPortNumOverride != 1) @@ -603,6 +602,7 @@ mainInitialize(void) if (Config.Announce.on) eventAdd("send_announce", send_announce, NULL, 3600); eventAdd("ipcache_purgelru", (EVH) ipcache_purgelru, NULL, 10); + eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10); } first_time = 0; } diff --git a/src/neighbors.cc b/src/neighbors.cc index 6478d4fe22..c1ef1436e8 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,5 +1,5 @@ /* - * $Id: neighbors.cc,v 1.112 1997/02/07 04:56:17 wessels Exp $ + * $Id: neighbors.cc,v 1.113 1997/02/07 04:57:15 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -508,7 +508,7 @@ neighborsUdpPing(protodispatch_data * proto) debug(15, 4, "neighborsUdpPing: pinging peer %s for '%s'\n", e->host, url); - if (e->type == PEER_MULTICAST) + if (e->type == PEER_MULTICAST) comm_set_mcast_ttl(theOutIcpConnection, e->mcast_ttl); reqnum = storeReqnum(entry, request->method); debug(15, 3, "neighborsUdpPing: key = '%s'\n", entry->key); @@ -545,11 +545,11 @@ neighborsUdpPing(protodispatch_data * proto) debug(15, 3, "neighborsUdpPing: %s: ack_deficit = %d\n", e->host, e->stats.ack_deficit); if (e->type == PEER_MULTICAST) { - e->stats.ack_deficit = 0; - ICP_mcasts_sent++; + e->stats.ack_deficit = 0; + ICP_mcasts_sent++; } else if (neighborUp(e)) { /* its alive, expect a reply from it */ - mem->e_pings_n_pings++; + mem->e_pings_n_pings++; } else { /* Neighbor is dead; ping it anyway, but don't expect a reply */ /* log it once at the threshold */ @@ -583,7 +583,7 @@ neighborsUdpPing(protodispatch_data * proto) query, LOG_TAG_NONE, PROTO_NONE); - ICP_queries_sent++; + ICP_queries_sent++; } } else { debug(15, 6, "neighborsUdpPing: Source Ping: unknown host: %s\n", @@ -985,4 +985,3 @@ peerUpdateFudge(void *unused) eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10); debug(15, 3, "peerUpdateFudge: Factor = %d\n", MulticastFudgeFactor); } - diff --git a/src/stat.cc b/src/stat.cc index a95124bb23..dfb8d11617 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.124 1997/02/05 04:53:31 wessels Exp $ + * $Id: stat.cc,v 1.125 1997/02/07 04:57:16 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -563,7 +563,7 @@ server_list(const cacheinfo * obj, StoreEntry * sentry) if (e->host == NULL) fatal_dump("Found an peer without a hostname!"); storeAppendPrintf(sentry, "\n{%-11.11s: %s/%d/%d}\n", - e->type == PEER_PARENT ? "Parent" : "Sibling", + neighborTypeStr(e), e->host, e->http_port, e->icp_port); @@ -575,6 +575,9 @@ server_list(const cacheinfo * obj, StoreEntry * sentry) storeAppendPrintf(sentry, "{PINGS ACKED: %8d %3d%%}\n", e->stats.pings_acked, percent(e->stats.pings_acked, e->stats.pings_sent)); + storeAppendPrintf(sentry, "{FETCHES : %8d %3d%%}\n", + e->stats.fetches, + percent(e->stats.fetches, e->stats.pings_acked)); storeAppendPrintf(sentry, "{IGNORED : %8d %3d%%}\n", e->stats.ignored_replies, percent(e->stats.ignored_replies, e->stats.pings_acked)); @@ -582,15 +585,11 @@ server_list(const cacheinfo * obj, StoreEntry * sentry) for (op = ICP_OP_INVALID; op < ICP_OP_END; op++) { if (e->stats.counts[op] == 0) continue; - storeAppendPrintf(sentry, "{%-10.10s : %8d %3d%%}\n", + storeAppendPrintf(sentry, "{ %12.12s : %8d %3d%%}\n", IcpOpcodeStr[op], e->stats.counts[op], percent(e->stats.counts[op], e->stats.pings_acked)); } - storeAppendPrintf(sentry, "{FETCHES : %8d %3d%%}\n", - e->stats.fetches, - percent(e->stats.fetches, e->stats.pings_acked)); - if (e->last_fail_time) { storeAppendPrintf(sentry, "{Last failed connect() at: %s}\n", mkhttpdlogtime(&(e->last_fail_time))); @@ -1160,7 +1159,6 @@ log_enable(cacheinfo * obj, StoreEntry * sentry) debug(18, 0, "Cannot open logfile: %s\n", obj->logfilename); obj->logfile_status = LOG_DISABLE; } - } /* at the moment, store one char to make a storage manager happy */ storeAppendPrintf(sentry, " "); diff --git a/src/store.cc b/src/store.cc index 5cd9869028..b04fb442bd 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.208 1997/02/07 04:56:40 wessels Exp $ + * $Id: store.cc,v 1.209 1997/02/07 04:57:17 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -197,8 +197,8 @@ struct storeRebuild_data { }; struct _bucketOrder { - unsigned int bucket; - int index; + unsigned int bucket; + int index; }; /* initializtion flag */ @@ -2396,7 +2396,7 @@ storeRandomizeBuckets(void) qsort((char *) MaintBucketsOrder, store_buckets, sizeof(struct _bucketOrder), - (QS) compareBucketOrder); + (QS) compareBucketOrder); } static void @@ -2666,7 +2666,6 @@ storeWriteCleanLog(void) sprintf(tmp_error_buf, "Cannot open swap logfile: %s", swaplog_file); fatal(tmp_error_buf); } - stop = getCurrentTime(); r = stop - start; debug(20, 1, " Finished. Wrote %d lines.\n", n);