--------------------- PatchSet 2997 Date: 2001/09/09 16:25:21 Author: serassio Branch: nt-2_3-tolsty Tag: (none) Log: Fixed indent problems Members: src/neighbors.c:1.1.1.3.4.1.2.1.2.1->1.1.1.3.4.1.2.1.2.2 src/pconn.c:1.1.1.2.4.1.2.1.2.1->1.1.1.2.4.1.2.1.2.2 src/pump.c:1.1.1.3.4.1.2.1.2.1->1.1.1.3.4.1.2.1.2.2 Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.1.1.3.4.1.2.1.2.1 retrieving revision 1.1.1.3.4.1.2.1.2.2 diff -u -r1.1.1.3.4.1.2.1.2.1 -r1.1.1.3.4.1.2.1.2.2 --- squid/src/neighbors.c 27 Aug 2001 21:48:21 -0000 1.1.1.3.4.1.2.1.2.1 +++ squid/src/neighbors.c 9 Sep 2001 16:25:21 -0000 1.1.1.3.4.1.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: neighbors.c,v 1.1.1.3.4.1.2.1.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: neighbors.c,v 1.1.1.3.4.1.2.1.2.2 2001/09/09 16:25:21 serassio Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -96,7 +97,8 @@ return NULL; } -peer_t neighborType(const peer * p, const request_t * request) +peer_t +neighborType(const peer * p, const request_t * request) { const struct _domain_type *d = NULL; for (d = p->typelist; d; d = d->next) { @@ -347,7 +349,8 @@ } first_ping = Config.peers; cachemgrRegister("server_list", - "Peer Cache Statistics", neighborDumpPeers, 0, 1); + "Peer Cache Statistics", + neighborDumpPeers, 0, 1); cachemgrRegister("non_peers", "List of Unknown sites sending ICP messages", neighborDumpNonPeers, 0, 1); @@ -356,7 +359,10 @@ int neighborsUdpPing(request_t * request, StoreEntry * entry, - IRCB * callback, void *callback_data, int *exprep, int *timeout) + IRCB * callback, + void *callback_data, + int *exprep, + int *timeout) { const char *url = storeUrl(entry); MemObject *mem = entry->mem_obj; @@ -389,8 +395,7 @@ p->host, url); if (p->type == PEER_MULTICAST) mcastSetTtl(theOutIcpConnection, p->mcast.ttl); - debug(15, 3) ("neighborsUdpPing: key = '%s'\n", - storeKeyText(entry->key)); + debug(15, 3) ("neighborsUdpPing: key = '%s'\n", storeKeyText(entry->key)); debug(15, 3) ("neighborsUdpPing: reqnum = %d\n", reqnum); #if USE_HTCP @@ -400,12 +405,14 @@ } else #endif if (p->icp.port == echo_port) { - debug(15, 4) - ("neighborsUdpPing: Looks like a dumb cache, send DECHO ping\n"); + debug(15, 4) ("neighborsUdpPing: Looks like a dumb cache, send DECHO ping\n"); echo_hdr.reqnum = reqnum; query = icpCreateMessage(ICP_DECHO, 0, url, reqnum, 0); icpUdpSend(theOutIcpConnection, - &p->in_addr, query, LOG_ICP_QUERY, 0); + &p->in_addr, + query, + LOG_ICP_QUERY, + 0); } else { flags = 0; if (Config.onoff.query_icmp) @@ -413,7 +420,10 @@ flags |= ICP_FLAG_SRC_RTT; query = icpCreateMessage(ICP_QUERY, flags, url, reqnum, 0); icpUdpSend(theOutIcpConnection, - &p->in_addr, query, LOG_ICP_QUERY, 0); + &p->in_addr, + query, + LOG_ICP_QUERY, + 0); } queries_sent++; @@ -425,8 +435,7 @@ */ p->stats.last_reply = squid_curtime; (*exprep) += p->mcast.n_replies_expected; - } else if (squid_curtime - p->stats.last_query > - Config.Timeout.deadPeer) { + } else if (squid_curtime - p->stats.last_query > Config.Timeout.deadPeer) { /* * fake a recent reply if its been a long time since our * last query @@ -453,7 +462,8 @@ /* log it once at the threshold */ if (p->stats.logged_state == PEER_ALIVE) { debug(15, 1) ("Detected DEAD %s: %s/%d/%d\n", - neighborTypeStr(p), p->host, p->http_port, p->icp.port); + neighborTypeStr(p), + p->host, p->http_port, p->icp.port); p->stats.logged_state = PEER_DEAD; } } @@ -482,7 +492,10 @@ to_addr.sin_port = htons(echo_port); query = icpCreateMessage(ICP_SECHO, 0, url, reqnum, 0); icpUdpSend(theOutIcpConnection, - &to_addr, query, LOG_ICP_QUERY, 0); + &to_addr, + query, + LOG_ICP_QUERY, + 0); } } else { debug(15, 6) ("neighborsUdpPing: Source Ping: unknown host: %s\n", @@ -508,11 +521,11 @@ } /* lookup the digest of a given peer */ -lookup_t peerDigestLookup(peer * p, request_t * request, StoreEntry * entry) +lookup_t +peerDigestLookup(peer * p, request_t * request, StoreEntry * entry) { #if USE_CACHE_DIGESTS - const cache_key *key = - request ? storeKeyPublic(storeUrl(entry), request->method) : NULL; + const cache_key *key = request ? storeKeyPublic(storeUrl(entry), request->method) : NULL; assert(p); assert(request); debug(15, 5) ("peerDigestLookup: peer %s\n", p->host); @@ -616,7 +629,8 @@ { if (p->stats.logged_state == PEER_DEAD && p->tcp_up) { debug(15, 1) ("Detected REVIVED %s: %s/%d/%d\n", - neighborTypeStr(p), p->host, p->http_port, p->icp.port); + neighborTypeStr(p), + p->host, p->http_port, p->icp.port); p->stats.logged_state = PEER_ALIVE; } p->stats.last_reply = squid_curtime; @@ -647,7 +661,8 @@ { if (p->stats.logged_state == PEER_DEAD && p->tcp_up) { debug(15, 1) ("Detected REVIVED %s: %s/%d/%d\n", - neighborTypeStr(p), p->host, p->http_port, p->icp.port); + neighborTypeStr(p), + p->host, p->http_port, p->icp.port); p->stats.logged_state = PEER_ALIVE; } p->stats.last_reply = squid_curtime; @@ -724,8 +739,7 @@ * If a hit process is already started, then sobeit */ void -neighborsUdpAck(const cache_key * key, icp_common_t * header, - const struct sockaddr_in *from) +neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct sockaddr_in *from) { peer *p = NULL; StoreEntry *entry; @@ -788,16 +802,14 @@ if (p == NULL) { neighborIgnoreNonPeer(from, opcode); } else { - mem->ping_reply_callback(p, ntype, PROTO_ICP, header, - mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_HIT) { if (p == NULL) { neighborIgnoreNonPeer(from, opcode); } else { header->opcode = ICP_HIT; - mem->ping_reply_callback(p, ntype, PROTO_ICP, header, - mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_DECHO) { if (p == NULL) { @@ -806,8 +818,7 @@ debug_trap("neighborsUdpAck: Found non-ICP cache as SIBLING\n"); debug_trap("neighborsUdpAck: non-ICP neighbors must be a PARENT\n"); } else { - mem->ping_reply_callback(p, ntype, PROTO_ICP, header, - mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_SECHO) { if (p) { @@ -815,23 +826,18 @@ neighborCountIgnored(p); #if ALLOW_SOURCE_PING } else if (Config.onoff.source_ping) { - mem->ping_reply_callback(NULL, ntype, PROTO_ICP, header, - mem->ircb_data); + mem->ping_reply_callback(NULL, ntype, PROTO_ICP, header, mem->ircb_data); #endif } else { - debug(15, 1) ("Unsolicited SECHO from %s\n", - inet_ntoa(from->sin_addr)); + debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr)); } } else if (opcode == ICP_DENIED) { if (p == NULL) { neighborIgnoreNonPeer(from, opcode); } else if (p->stats.pings_acked > 100) { if (100 * p->icp.counts[ICP_DENIED] / p->stats.pings_acked > 95) { - debug(15, 0) ("95%% of replies from '%s' are UDP_DENIED\n", - p->host); - debug(15, - 0) ("Disabling '%s', please check your configuration.\n", - p->host); + debug(15, 0) ("95%% of replies from '%s' are UDP_DENIED\n", p->host); + debug(15, 0) ("Disabling '%s', please check your configuration.\n", p->host); neighborRemove(p); p = NULL; } else { @@ -941,8 +947,7 @@ } for (j = 0; j < (int) ia->count && j < PEER_MAX_ADDRESSES; j++) { p->addresses[j] = ia->in_addrs[j]; - debug(15, 2) ("--> IP address #%d: %s\n", j, - inet_ntoa(p->addresses[j])); + debug(15, 2) ("--> IP address #%d: %s\n", j, inet_ntoa(p->addresses[j])); p->n_addresses++; } ap = &p->in_addr; @@ -983,8 +988,8 @@ { peer *p = data; int fd; - fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing, 0, - COMM_NONBLOCKING, p->host); + fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing, + 0, COMM_NONBLOCKING, p->host); if (fd < 0) return; p->test_fd = fd; @@ -996,7 +1001,10 @@ { peer *p = data; commConnectStart(p->test_fd, - p->host, p->http_port, peerCheckConnectDone, p); + p->host, + p->http_port, + peerCheckConnectDone, + p); } static void @@ -1033,7 +1041,9 @@ if (p->mcast.flags.count_event_pending) return; eventAdd("peerCountMcastPeersStart", - peerCountMcastPeersStart, p, (double) when, 1); + peerCountMcastPeersStart, + p, + (double) when, 1); p->mcast.flags.count_event_pending = 1; } @@ -1066,11 +1076,16 @@ p->mcast.id = mem->id; reqnum = icpSetCacheKey(fake->key); query = icpCreateMessage(ICP_QUERY, 0, url, reqnum, 0); - icpUdpSend(theOutIcpConnection, &p->in_addr, query, LOG_ICP_QUERY, 0); + icpUdpSend(theOutIcpConnection, + &p->in_addr, + query, + LOG_ICP_QUERY, + 0); fake->ping_status = PING_WAITING; eventAdd("peerCountMcastPeersDone", peerCountMcastPeersDone, - psstate, (double) Config.Timeout.mcast_icp_query, 1); + psstate, + (double) Config.Timeout.mcast_icp_query, 1); p->mcast.flags.counting = 1; peerCountMcastPeersSchedule(p, MCAST_COUNT_RATE); } @@ -1083,9 +1098,14 @@ StoreEntry *fake = psstate->entry; p->mcast.flags.counting = 0; p->mcast.avg_n_members = doubleAverage(p->mcast.avg_n_members, - (double) psstate->ping.n_recv, ++p->mcast.n_times_counted, 10); + (double) psstate->ping.n_recv, + ++p->mcast.n_times_counted, + 10); debug(15, 1) ("Group %s: %d replies, %4.1f average, RTT %d\n", - p->host, psstate->ping.n_recv, p->mcast.avg_n_members, p->stats.rtt); + p->host, + psstate->ping.n_recv, + p->mcast.avg_n_members, + p->stats.rtt); p->mcast.n_replies_expected = (int) p->mcast.avg_n_members; EBIT_SET(fake->flags, ENTRY_ABORTED); requestUnlink(fake->mem_obj->request); @@ -1097,8 +1117,7 @@ } 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; @@ -1108,8 +1127,7 @@ assert(fake); assert(mem); psstate->ping.n_recv++; - p->stats.rtt = - intAverage(p->stats.rtt, rtt, psstate->ping.n_recv, RTT_AV_FACTOR); + p->stats.rtt = intAverage(p->stats.rtt, rtt, psstate->ping.n_recv, RTT_AV_FACTOR); } static void @@ -1170,7 +1188,10 @@ for (e = peers; e; e = e->next) { assert(e->host != NULL); storeAppendPrintf(sentry, "\n%-11.11s: %s/%d/%d\n", - neighborTypeStr(e), e->host, e->http_port, e->icp.port); + neighborTypeStr(e), + e->host, + e->http_port, + e->icp.port); storeAppendPrintf(sentry, "Flags :"); dump_peer_options(sentry, e); for (i = 0; i < e->n_addresses; i++) { @@ -1189,7 +1210,8 @@ 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)); + 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)); @@ -1234,8 +1256,7 @@ #if USE_HTCP void -neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, - const struct sockaddr_in *from) +neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const struct sockaddr_in *from) { StoreEntry *e = storeGet(key); MemObject *mem = NULL; Index: squid/src/pconn.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/pconn.c,v retrieving revision 1.1.1.2.4.1.2.1.2.1 retrieving revision 1.1.1.2.4.1.2.1.2.2 diff -u -r1.1.1.2.4.1.2.1.2.1 -r1.1.1.2.4.1.2.1.2.2 --- squid/src/pconn.c 27 Aug 2001 21:48:21 -0000 1.1.1.2.4.1.2.1.2.1 +++ squid/src/pconn.c 9 Sep 2001 16:25:21 -0000 1.1.1.2.4.1.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: pconn.c,v 1.1.1.2.4.1.2.1.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: pconn.c,v 1.1.1.2.4.1.2.1.2.2 2001/09/09 16:25:21 serassio Exp $ * * DEBUG: section 48 Persistent Connections * AUTHOR: Duane Wessels @@ -34,8 +35,7 @@ #define PCONN_C #include "squid.h" -struct _pconn -{ +struct _pconn { char *key; struct _pconn *next; int *fds; @@ -132,7 +132,10 @@ int i; storeAppendPrintf(e, "Client-side persistent connection counts:\n" - "\n" "\treq/\n" "\tconn count\n" "\t---- ---------\n"); + "\n" + "\treq/\n" + "\tconn count\n" + "\t---- ---------\n"); for (i = 0; i < PCONN_HIST_SZ; i++) { if (client_pconn_hist[i] == 0) continue; @@ -141,7 +144,10 @@ storeAppendPrintf(e, "\n" "Server-side persistent connection counts:\n" - "\n" "\treq/\n" "\tconn count\n" "\t---- ---------\n"); + "\n" + "\treq/\n" + "\tconn count\n" + "\t---- ---------\n"); for (i = 0; i < PCONN_HIST_SZ; i++) { if (server_pconn_hist[i] == 0) continue; @@ -163,7 +169,8 @@ server_pconn_hist[i] = 0; } cachemgrRegister("pconn", - "Persistent Connection Utilization Histograms", pconnHistDump, 0, 1); + "Persistent Connection Utilization Histograms", + pconnHistDump, 0, 1); debug(48, 3) ("persistent connection module initialized\n"); } @@ -237,4 +244,4 @@ else assert(0); } -#undef PCONN_C +#undef PCONN_C \ No newline at end of file Index: squid/src/pump.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/pump.c,v retrieving revision 1.1.1.3.4.1.2.1.2.1 retrieving revision 1.1.1.3.4.1.2.1.2.2 diff -u -r1.1.1.3.4.1.2.1.2.1 -r1.1.1.3.4.1.2.1.2.2 --- squid/src/pump.c 27 Aug 2001 21:48:21 -0000 1.1.1.3.4.1.2.1.2.1 +++ squid/src/pump.c 9 Sep 2001 16:25:21 -0000 1.1.1.3.4.1.2.1.2.2 @@ -1,5 +1,5 @@ /* - * $Id: pump.c,v 1.1.1.3.4.1.2.1.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: pump.c,v 1.1.1.3.4.1.2.1.2.2 2001/09/09 16:25:21 serassio Exp $ * * DEBUG: section 61 PUMP handler * AUTHOR: Kostas Anagnostakis @@ -37,8 +37,7 @@ #define PUMP_MAXBUFFER 2*SQUID_UDP_SO_SNDBUF -struct _PumpStateData -{ +struct _PumpStateData { FwdState *fwd; request_t *req; int c_fd; /* client fd */ @@ -49,11 +48,9 @@ StoreEntry *reply_entry; /* the reply entry */ CWCB *callback; /* what to do when we finish sending */ void *cbdata; /* callback data passed to callback func */ - struct - { + struct { int closing:1; - } - flags; + } flags; struct _PumpStateData *next; }; @@ -167,7 +164,8 @@ pumpServerCopyComplete(p->s_fd, NULL, 0, DISK_OK, p); } else { storeClientCopy(p->request_entry, p->sent, p->sent, 4096, - memAllocate(MEM_4K_BUF), pumpServerCopy, p); + memAllocate(MEM_4K_BUF), + pumpServerCopy, p); } } @@ -192,8 +190,7 @@ } static void -pumpServerCopyComplete(int fd, char *bufnotused, size_t size, int errflag, - void *data) +pumpServerCopyComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) { PumpStateData *p = data; int sfd; @@ -215,7 +212,8 @@ assert(p->sent <= p->req->content_length); if (p->sent < p->req->content_length) { storeClientCopy(p->request_entry, p->sent, p->sent, 4096, - memAllocate(MEM_4K_BUF), pumpServerCopy, p); + memAllocate(MEM_4K_BUF), + pumpServerCopy, p); return; } debug(61, 5) ("pumpServerCopyComplete: Done!\n", size); @@ -239,8 +237,7 @@ PumpStateData *p = data; StoreEntry *req = p->request_entry; LOCAL_ARRAY(char, buf, SQUID_TCP_SO_RCVBUF); - int bytes_to_read = - XMIN(p->req->content_length - p->rcvd, SQUID_TCP_SO_RCVBUF); + int bytes_to_read = XMIN(p->req->content_length - p->rcvd, SQUID_TCP_SO_RCVBUF); int len = 0; errno = 0; Counter.syscalls.sock.reads++; @@ -256,7 +253,10 @@ debug(61, 5) ("pumpReadFromClient: FD %d: len %d and ignore!\n", fd, len); commSetSelect(fd, - COMM_SELECT_READ, pumpReadFromClient, p, Config.Timeout.read); + COMM_SELECT_READ, + pumpReadFromClient, + p, + Config.Timeout.read); } else { debug(61, 2) ("pumpReadFromClient: aborted.\n"); pumpClose(p); @@ -274,11 +274,7 @@ if (len > 0) { int delta = p->rcvd + len - p->req->content_length; if (delta > 0 && p->req->flags.proxy_keepalive) { - debug(61, delta == 2 ? 3 : 1) - - - ("pumpReadFromClient: Warning: read %d bytes past content-length, truncating\n", - delta); + debug(61, delta == 2 ? 3 : 1) ("pumpReadFromClient: Warning: read %d bytes past content-length, truncating\n", delta); len = p->req->content_length - p->rcvd; } storeAppend(req, buf, len); @@ -369,8 +365,7 @@ p->request_entry = NULL; } if (rep != NULL) { - debug(61, 3) ("pumpFree: did the server-side FD (%d) get closed?\n", - p->s_fd); + debug(61, 3) ("pumpFree: did the server-side FD (%d) get closed?\n", p->s_fd); storeUnlockObject(rep); p->reply_entry = NULL; }