--------------------- PatchSet 2996 Date: 2001/09/09 16:18:25 Author: serassio Branch: nt-2_3-tolsty Tag: (none) Log: Fixed indent problems Members: src/icp_v2.c:1.1.1.3.4.1.2.2.2.1->1.1.1.3.4.1.2.2.2.2 src/icp_v3.c:1.1.1.3.4.1.2.1.2.1->1.1.1.3.4.1.2.1.2.2 src/ident.c:1.1.1.3.4.1.2.1.2.1->1.1.1.3.4.1.2.1.2.2 src/useragent.c:1.1.1.3.4.1.2.10.2.2->1.1.1.3.4.1.2.10.2.3 Index: squid/src/icp_v2.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/icp_v2.c,v retrieving revision 1.1.1.3.4.1.2.2.2.1 retrieving revision 1.1.1.3.4.1.2.2.2.2 diff -u -r1.1.1.3.4.1.2.2.2.1 -r1.1.1.3.4.1.2.2.2.2 --- squid/src/icp_v2.c 27 Aug 2001 21:48:21 -0000 1.1.1.3.4.1.2.2.2.1 +++ squid/src/icp_v2.c 9 Sep 2001 16:18:25 -0000 1.1.1.3.4.1.2.2.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: icp_v2.c,v 1.1.1.3.4.1.2.2.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: icp_v2.c,v 1.1.1.3.4.1.2.2.2.2 2001/09/09 16:18:25 serassio Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -45,8 +46,7 @@ static icpUdpData *IcpQueueTail = NULL; static void -icpLogIcp(struct in_addr caddr, log_type logcode, int len, const char *url, - int delay) +icpLogIcp(struct in_addr caddr, log_type logcode, int len, const char *url, int delay) { AccessLogEntry al; if (LOG_TAG_NONE == logcode) @@ -84,8 +84,12 @@ } void * -icpCreateMessage(icp_opcode opcode, - int flags, const char *url, int reqnum, int pad) +icpCreateMessage( + icp_opcode opcode, + int flags, + const char *url, + int reqnum, + int pad) { char *buf = NULL; icp_common_t *headerp = NULL; @@ -113,7 +117,9 @@ int icpUdpSend(int fd, const struct sockaddr_in *to, - icp_common_t * msg, log_type logcode, int delay) + icp_common_t * msg, + log_type logcode, + int delay) { icpUdpData *queue; int x; @@ -122,7 +128,9 @@ debug(12, 5) ("icpUdpSend: FD %d sending %s, %d bytes to %s:%d\n", fd, icp_opcode_str[msg->opcode], - len, inet_ntoa(to->sin_addr), ntohs(to->sin_port)); + len, + inet_ntoa(to->sin_addr), + ntohs(to->sin_port)); x = comm_udp_sendto(fd, to, sizeof(*to), msg, len); if (x >= 0) { /* successfully written */ @@ -244,11 +252,9 @@ } /* The peer is allowed to use this cache */ entry = storeGetPublic(url, METHOD_GET); - debug(12, 5) ("icpHandleIcpV2: OPCODE %s\n", - icp_opcode_str[header.opcode]); + debug(12, 5) ("icpHandleIcpV2: OPCODE %s\n", icp_opcode_str[header.opcode]); if (icpCheckUdpHit(entry, icp_request)) { - reply = - icpCreateMessage(ICP_HIT, flags, url, header.reqnum, src_rtt); + reply = icpCreateMessage(ICP_HIT, flags, url, header.reqnum, src_rtt); icpUdpSend(fd, &from, reply, LOG_UDP_HIT, 0); break; } @@ -258,23 +264,16 @@ } /* if store is rebuilding, return a UDP_HIT, but not a MISS */ if (store_dirs_rebuilding && opt_reload_hit_only) { - reply = - icpCreateMessage(ICP_MISS_NOFETCH, flags, url, header.reqnum, - src_rtt); + reply = icpCreateMessage(ICP_MISS_NOFETCH, flags, url, header.reqnum, src_rtt); icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, 0); } else if (hit_only_mode_until > squid_curtime) { - reply = - icpCreateMessage(ICP_MISS_NOFETCH, flags, url, header.reqnum, - src_rtt); + reply = icpCreateMessage(ICP_MISS_NOFETCH, flags, url, header.reqnum, src_rtt); icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, 0); } else if (Config.onoff.test_reachability && rtt == 0) { - reply = - icpCreateMessage(ICP_MISS_NOFETCH, flags, url, header.reqnum, - src_rtt); + reply = icpCreateMessage(ICP_MISS_NOFETCH, flags, url, header.reqnum, src_rtt); icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, 0); } else { - reply = - icpCreateMessage(ICP_MISS, flags, url, header.reqnum, src_rtt); + reply = icpCreateMessage(ICP_MISS, flags, url, header.reqnum, src_rtt); icpUdpSend(fd, &from, reply, LOG_UDP_MISS, 0); } break; @@ -295,7 +294,9 @@ } url = buf + sizeof(icp_common_t); debug(12, 3) ("icpHandleIcpV2: %s from %s for '%s'\n", - icp_opcode_str[header.opcode], inet_ntoa(from.sin_addr), url); + icp_opcode_str[header.opcode], + inet_ntoa(from.sin_addr), + url); key = icpGetCacheKey(url, (int) header.reqnum); /* call neighborsUdpAck even if ping_status != PING_WAITING */ neighborsUdpAck(key, &header, &from); @@ -321,7 +322,8 @@ struct in_addr a; debug(12, 9) ("opcode: %3d %s\n", - (int) pkt->opcode, icp_opcode_str[pkt->opcode]); + (int) pkt->opcode, + icp_opcode_str[pkt->opcode]); debug(12, 9) ("version: %-8d\n", (int) pkt->version); debug(12, 9) ("length: %-8d\n", (int) ntohs(pkt->length)); debug(12, 9) ("reqnum: %-8d\n", ntohl(pkt->reqnum)); @@ -349,7 +351,10 @@ Counter.syscalls.sock.recvfroms++; len = recvfrom(sock, buf, - SQUID_UDP_SO_RCVBUF - 1, 0, (struct sockaddr *) &from, &from_len); + SQUID_UDP_SO_RCVBUF - 1, + 0, + (struct sockaddr *) &from, + &from_len); if (len == 0) break; if (len < 0) { @@ -370,7 +375,9 @@ icpCount(buf, RECV, (size_t) len, 0); buf[len] = '\0'; debug(12, 4) ("icpHandleUdp: FD %d: received %d bytes from %s.\n", - sock, len, inet_ntoa(from.sin_addr)); + sock, + len, + inet_ntoa(from.sin_addr)); #ifdef ICP_PACKET_DUMP icpPktDump(buf); #endif @@ -384,9 +391,10 @@ else if (icp_version == ICP_VERSION_3) icpHandleIcpV3(sock, from, buf, len); else - debug(12, - 1) ("WARNING: Unused ICP version %d received from %s:%d\n", - icp_version, inet_ntoa(from.sin_addr), ntohs(from.sin_port)); + debug(12, 1) ("WARNING: Unused ICP version %d received from %s:%d\n", + icp_version, + inet_ntoa(from.sin_addr), + ntohs(from.sin_port)); } } @@ -404,25 +412,41 @@ if ((port = Config.Port.icp) <= 0) return; enter_suid(); - theInIcpConnection = comm_open(SOCK_DGRAM, 0, Config.Addrs.udp_incoming, - port, COMM_NONBLOCKING, "ICP Socket"); + theInIcpConnection = comm_open(SOCK_DGRAM, + 0, + Config.Addrs.udp_incoming, + port, + COMM_NONBLOCKING, + "ICP Socket"); leave_suid(); if (theInIcpConnection < 0) fatal("Cannot open ICP Port"); - commSetSelect(theInIcpConnection, COMM_SELECT_READ, icpHandleUdp, NULL, 0); + commSetSelect(theInIcpConnection, + COMM_SELECT_READ, + icpHandleUdp, + NULL, + 0); for (s = Config.mcast_group_list; s; s = s->next) ipcache_nbgethostbyname(s->key, mcastJoinGroups, NULL); debug(12, 1) ("Accepting ICP messages at %s, port %d, FD %d.\n", - inet_ntoa(Config.Addrs.udp_incoming), (int) port, theInIcpConnection); + inet_ntoa(Config.Addrs.udp_incoming), + (int) port, theInIcpConnection); if ((addr = Config.Addrs.udp_outgoing).s_addr != no_addr.s_addr) { enter_suid(); - theOutIcpConnection = comm_open(SOCK_DGRAM, 0, addr, port, - COMM_NONBLOCKING, "ICP Port"); + theOutIcpConnection = comm_open(SOCK_DGRAM, + 0, + addr, + port, + COMM_NONBLOCKING, + "ICP Port"); leave_suid(); if (theOutIcpConnection < 0) fatal("Cannot open Outgoing ICP Port"); commSetSelect(theOutIcpConnection, - COMM_SELECT_READ, icpHandleUdp, NULL, 0); + COMM_SELECT_READ, + icpHandleUdp, + NULL, + 0); debug(12, 1) ("Outgoing ICP messages on port %d, FD %d.\n", (int) port, theOutIcpConnection); fd_note(theOutIcpConnection, "Outgoing ICP socket"); @@ -433,7 +457,8 @@ memset(&theOutICPAddr, '\0', sizeof(struct in_addr)); len = sizeof(struct sockaddr_in); memset(&xaddr, '\0', len); - x = getsockname(theOutIcpConnection, (struct sockaddr *) &xaddr, &len); + x = getsockname(theOutIcpConnection, + (struct sockaddr *) &xaddr, &len); if (x < 0) debug(50, 1) ("theOutIcpConnection FD %d: getsockname: %s\n", theOutIcpConnection, xstrerror()); @@ -539,4 +564,4 @@ return queried_keys[reqnum & N_QUERIED_KEYS_MASK]; return storeKeyPublic(url, METHOD_GET); } -#undef ICP_V2_C +#undef ICP_V2_C \ No newline at end of file Index: squid/src/icp_v3.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/icp_v3.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/icp_v3.c 27 Aug 2001 21:48:21 -0000 1.1.1.3.4.1.2.1.2.1 +++ squid/src/icp_v3.c 9 Sep 2001 16:18:25 -0000 1.1.1.3.4.1.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: icp_v3.c,v 1.1.1.3.4.1.2.1.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: icp_v3.c,v 1.1.1.3.4.1.2.1.2.2 2001/09/09 16:18:25 serassio Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -107,12 +108,10 @@ } /* if store is rebuilding, return a UDP_HIT, but not a MISS */ if (opt_reload_hit_only && store_dirs_rebuilding) { - reply = - icpCreateMessage(ICP_MISS_NOFETCH, 0, url, header.reqnum, 0); + reply = icpCreateMessage(ICP_MISS_NOFETCH, 0, url, header.reqnum, 0); icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, 0); } else if (hit_only_mode_until > squid_curtime) { - reply = - icpCreateMessage(ICP_MISS_NOFETCH, 0, url, header.reqnum, 0); + reply = icpCreateMessage(ICP_MISS_NOFETCH, 0, url, header.reqnum, 0); icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, 0); } else { reply = icpCreateMessage(ICP_MISS, 0, url, header.reqnum, 0); @@ -136,7 +135,9 @@ } url = buf + sizeof(icp_common_t); debug(12, 3) ("icpHandleIcpV3: %s from %s for '%s'\n", - icp_opcode_str[header.opcode], inet_ntoa(from.sin_addr), url); + icp_opcode_str[header.opcode], + inet_ntoa(from.sin_addr), + url); key = icpGetCacheKey(url, (int) header.reqnum); /* call neighborsUdpAck even if ping_status != PING_WAITING */ neighborsUdpAck(key, &header, &from); @@ -154,4 +155,4 @@ if (icp_request) requestDestroy(icp_request); } -#undef ICP_V3_C +#undef ICP_V3_C \ No newline at end of file Index: squid/src/ident.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ident.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/ident.c 27 Aug 2001 21:48:21 -0000 1.1.1.3.4.1.2.1.2.1 +++ squid/src/ident.c 9 Sep 2001 16:18:25 -0000 1.1.1.3.4.1.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: ident.c,v 1.1.1.3.4.1.2.1.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: ident.c,v 1.1.1.3.4.1.2.1.2.2 2001/09/09 16:18:25 serassio Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -39,24 +40,20 @@ #define IDENT_PORT 113 #define IDENT_KEY_SZ 50 -typedef struct _IdentClient -{ +typedef struct _IdentClient { IDCB *callback; void *callback_data; struct _IdentClient *next; -} -IdentClient; +} IdentClient; -typedef struct _IdentStateData -{ +typedef struct _IdentStateData { char *key; struct _IdentStateData *next; int fd; /* IDENT fd */ struct sockaddr_in me; struct sockaddr_in my_peer; IdentClient *clients; -} -IdentStateData; +} IdentStateData; static PF identReadReply; static PF identClose; @@ -126,7 +123,8 @@ } memBufDefInit(&mb); memBufPrintf(&mb, "%d, %d\r\n", - ntohs(state->my_peer.sin_port), ntohs(state->me.sin_port)); + ntohs(state->my_peer.sin_port), + ntohs(state->me.sin_port)); comm_write_mbuf(fd, mb, NULL, state); commSetSelect(fd, COMM_SELECT_READ, identReadReply, state, 0); commSetTimeout(fd, Config.Timeout.ident, identTimeout, state); @@ -187,8 +185,7 @@ * start a TCP connection to the peer host on port 113 */ void -identStart(struct sockaddr_in *me, struct sockaddr_in *my_peer, IDCB * callback, - void *data) +identStart(struct sockaddr_in *me, struct sockaddr_in *my_peer, IDCB * callback, void *data) { IdentStateData *state; int fd; @@ -196,15 +193,22 @@ char key2[IDENT_KEY_SZ]; char key[IDENT_KEY_SZ]; snprintf(key1, IDENT_KEY_SZ, "%s:%d", - inet_ntoa(me->sin_addr), ntohs(me->sin_port)); + inet_ntoa(me->sin_addr), + ntohs(me->sin_port)); snprintf(key2, IDENT_KEY_SZ, "%s:%d", - inet_ntoa(my_peer->sin_addr), ntohs(my_peer->sin_port)); + inet_ntoa(my_peer->sin_addr), + ntohs(my_peer->sin_port)); snprintf(key, IDENT_KEY_SZ, "%s,%s", key1, key2); if ((state = hash_lookup(ident_hash, key)) != NULL) { identClientAdd(state, callback, data); return; } - fd = comm_open(SOCK_STREAM, 0, me->sin_addr, 0, COMM_NONBLOCKING, "ident"); + fd = comm_open(SOCK_STREAM, + 0, + me->sin_addr, + 0, + COMM_NONBLOCKING, + "ident"); if (fd == COMM_ERROR) { /* Failed to get a local socket */ callback(NULL, data); @@ -218,18 +222,23 @@ state->my_peer = *my_peer; identClientAdd(state, callback, data); hash_join(ident_hash, (hash_link *) state); - comm_add_close_handler(fd, identClose, state); + comm_add_close_handler(fd, + identClose, + state); commSetTimeout(fd, Config.Timeout.ident, identTimeout, state); commConnectStart(fd, inet_ntoa(state->my_peer.sin_addr), - IDENT_PORT, identConnectDone, state); + IDENT_PORT, + identConnectDone, + state); } void identInit(void) { ident_hash = hash_create((HASHCMP *) strcmp, - hashPrime(Squid_MaxFD / 8), hash4); + hashPrime(Squid_MaxFD / 8), + hash4); } #endif Index: squid/src/useragent.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/useragent.c,v retrieving revision 1.1.1.3.4.1.2.10.2.2 retrieving revision 1.1.1.3.4.1.2.10.2.3 diff -u -r1.1.1.3.4.1.2.10.2.2 -r1.1.1.3.4.1.2.10.2.3 --- squid/src/useragent.c 9 Sep 2001 15:49:04 -0000 1.1.1.3.4.1.2.10.2.2 +++ squid/src/useragent.c 9 Sep 2001 16:18:25 -0000 1.1.1.3.4.1.2.10.2.3 @@ -1,6 +1,6 @@ /* - * $Id: useragent.c,v 1.1.1.3.4.1.2.10.2.2 2001/09/09 15:49:04 serassio Exp $ + * $Id: useragent.c,v 1.1.1.3.4.1.2.10.2.3 2001/09/09 16:18:25 serassio Exp $ * * DEBUG: section 40 User-Agent logging * AUTHOR: Joe Ramey @@ -142,4 +142,4 @@ } cache_useragent_log = NULL; #endif -} \ No newline at end of file +}