--------------------- PatchSet 4576 Date: 2002/07/22 16:52:57 Author: serassio Branch: nt-2_5 Tag: (none) Log: Added experimental pinger disable option Members: src/cf.data.pre:1.49.2.5.4.11->1.49.2.5.4.12 src/icmp.c:1.4.74.5->1.4.74.6 Index: squid/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v retrieving revision 1.49.2.5.4.11 retrieving revision 1.49.2.5.4.12 diff -u -r1.49.2.5.4.11 -r1.49.2.5.4.12 --- squid/src/cf.data.pre 22 Jul 2002 09:07:29 -0000 1.49.2.5.4.11 +++ squid/src/cf.data.pre 22 Jul 2002 16:52:57 -0000 1.49.2.5.4.12 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.49.2.5.4.11 2002/07/22 09:07:29 serassio Exp $ +# $Id: cf.data.pre,v 1.49.2.5.4.12 2002/07/22 16:52:57 serassio Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1170,6 +1170,7 @@ IFDEF: USE_ICMP DOC_START Specify the location of the executable for the pinger process. + To disable, enter "none". DOC_END Index: squid/src/icmp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/icmp.c,v retrieving revision 1.4.74.5 retrieving revision 1.4.74.6 diff -u -r1.4.74.5 -r1.4.74.6 --- squid/src/icmp.c 22 Jul 2002 09:07:29 -0000 1.4.74.5 +++ squid/src/icmp.c 22 Jul 2002 16:52:57 -0000 1.4.74.6 @@ -1,6 +1,6 @@ /* - * $Id: icmp.c,v 1.4.74.5 2002/07/22 09:07:29 serassio Exp $ + * $Id: icmp.c,v 1.4.74.6 2002/07/22 16:52:57 serassio Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -76,6 +76,8 @@ static int fail_count = 0; pingerReplyData preply; static struct sockaddr_in F; + if (icmp_sock < 0) + return; commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0); memset(&preply, '\0', sizeof(pingerReplyData)); statCounter.syscalls.sock.recvfroms++; @@ -156,6 +158,8 @@ icmpPing(struct in_addr to) { #if USE_ICMP + if (icmp_sock < 0) + return; icmpSendEcho(to, S_ICMP_ECHO, NULL, 0); #endif } @@ -168,6 +172,8 @@ char *payload; int len; int ulen; + if (icmp_sock < 0) + return; debug(37, 3) ("icmpSourcePing: '%s'\n", url); if ((ulen = strlen(url)) > MAX_URL) return; @@ -186,6 +192,8 @@ icmpDomainPing(struct in_addr to, const char *domain) { #if USE_ICMP + if (icmp_sock < 0) + return; debug(37, 3) ("icmpDomainPing: '%s'\n", domain); icmpSendEcho(to, S_ICMP_DOM, domain, 0); #endif @@ -199,6 +207,10 @@ int x; int rfd; int wfd; + if (strcmp(Config.Program.pinger, "none") == 0) { + debug(29, 1) ("Pinger disabled\n"); + return; + } args[0] = "(pinger)"; args[1] = NULL; x = ipcCreate(IPC_UDP_SOCKET,