]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
We must disable read handlers for OUTGOING UDP sockets during shutdown.
authorwessels <>
Fri, 2 Jan 1998 13:56:51 +0000 (13:56 +0000)
committerwessels <>
Fri, 2 Jan 1998 13:56:51 +0000 (13:56 +0000)
src/icp_v2.cc
src/main.cc

index bf2dee71fcc74cb53e604995fe22ff8d94d54e61..426d3c784e9fa56dc684574f7487e27fbd208ffb 100644 (file)
@@ -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 {
index 1565f699be8f71597bbf648e76b76e4b71a634ab..370e3abd380f2d13eb59f1780c519b3366faca36 100644 (file)
@@ -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