From: wessels <> Date: Fri, 2 Jan 1998 13:56:51 +0000 (+0000) Subject: We must disable read handlers for OUTGOING UDP sockets during shutdown. X-Git-Tag: SQUID_3_0_PRE1~4295 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e948d78b0ee0e9f6adfa403dd48576a32697658;p=thirdparty%2Fsquid.git We must disable read handlers for OUTGOING UDP sockets during shutdown. --- diff --git a/src/icp_v2.cc b/src/icp_v2.cc index bf2dee71fc..426d3c784e 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -460,7 +460,7 @@ icpConnectionsOpen(void) NULL, 0); for (s = Config.mcast_group_list; s; s = s->next) ipcache_nbgethostbyname(s->key, mcastJoinGroups, NULL); - debug(1, 1) ("Accepting ICP connections on port %d, FD %d.\n", + debug(1, 1) ("Accepting ICP messages on port %d, FD %d.\n", (int) port, theInIcpConnection); if ((addr = Config.Addrs.udp_outgoing).s_addr != no_addr.s_addr) { enter_suid(); @@ -477,8 +477,8 @@ icpConnectionsOpen(void) COMM_SELECT_READ, icpHandleUdp, NULL, 0); - debug(1, 1) ("Accepting ICP connections on port %d, FD %d.\n", - (int) port, theInIcpConnection); + debug(1, 1) ("Outgoing ICP messages on port %d, FD %d.\n", + (int) port, theOutIcpConnection); fd_note(theOutIcpConnection, "Outgoing ICP socket"); fd_note(theInIcpConnection, "Incoming ICP socket"); } else { diff --git a/src/main.cc b/src/main.cc index 1565f699be..370e3abd38 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.199 1997/12/30 04:22:06 wessels Exp $ + * $Id: main.cc,v 1.200 1998/01/02 06:56:52 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -342,7 +342,7 @@ serverConnectionsClose(void) } } NHttpSockets = 0; - if (theInIcpConnection >= 0) { + if (theInIcpConnection > -1) { /* NOTE, don't close outgoing ICP connection, we need to write to * it during shutdown */ debug(1, 1) ("FD %d Closing ICP connection\n", @@ -357,6 +357,14 @@ serverConnectionsClose(void) 0); theInIcpConnection = -1; } + /* + * Normally we only write to the outgoing ICP socket, but we + * also have a read handler there to catch messages sent to that + * specific interface. During shutdown, we must disable reading + * on the outgoing socket. + */ + if (theOutIcpConnection > -1) + commSetSelect(theOutIcpConnection, COMM_SELECT_READ, NULL, NULL, 0); if (icmp_sock > -1) icmpClose(); #ifdef SQUID_SNMP