NULL, 0);
for (s = Config.mcast_group_list; s; s = s->next)
ipcache_nbgethostbyname(s->key, mcastJoinGroups, NULL);
- debug(1, 1) ("Accepting ICP messages on port %d, FD %d.\n",
+ debug(12, 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();
COMM_SELECT_READ,
icpHandleUdp,
NULL, 0);
- debug(1, 1) ("Outgoing ICP messages on port %d, FD %d.\n",
+ debug(12, 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");
theOutICPAddr = xaddr.sin_addr;
}
+/*
+ * icpConnectionShutdown only closes the 'in' socket if it is
+ * different than the 'out' socket.
+ */
void
-icpConnectionsClose(void)
+icpConnectionShutdown(void)
{
if (theInIcpConnection < 0)
return;
- debug(1, 1) ("FD %d Closing ICP connection\n", theInIcpConnection);
- if (theInIcpConnection != theOutIcpConnection)
+ if (theInIcpConnection != theOutIcpConnection) {
+ debug(12, 1) ("FD %d Closing ICP connection\n", theInIcpConnection);
comm_close(theInIcpConnection);
+ }
/*
* Here we set 'theInIcpConnection' to -1 even though the ICP 'in'
* and 'out' sockets might be just one FD. This prevents this
assert(theOutIcpConnection > -1);
commSetSelect(theOutIcpConnection, COMM_SELECT_READ, NULL, NULL, 0);
}
+
+void
+icpConnectionClose(void)
+{
+ icpConnectionShutdown();
+ if (theOutIcpConnection > -1) {
+ debug(12, 1) ("FD %d Closing ICP connection\n", theOutIcpConnection);
+ comm_close(theOutIcpConnection);
+ }
+}
/*
- * $Id: main.cc,v 1.214 1998/02/06 17:30:53 wessels Exp $
+ * $Id: main.cc,v 1.215 1998/02/06 23:58:04 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
* is pending
*/
clientHttpConnectionsClose();
- icpConnectionsClose();
+ icpConnectionShutdown();
icmpClose();
#ifdef SQUID_SNMP
- snmpConnectionClose();
+ snmpConnectionShutdown();
#endif
}
debug(1, 0) ("Restarting Squid Cache (version %s)...\n", version_string);
/* Already called serverConnectionsClose and ipcacheShutdownServers() */
serverConnectionsClose();
- if (theOutIcpConnection > 0) {
- comm_close(theOutIcpConnection);
- theOutIcpConnection = -1;
- }
+ icpConnectionClose();
+#ifdef SQUID_SNMP
+ snmpConnectionClose();
+#endif
dnsShutdownServers();
asnCleanup();
redirectShutdownServers();
-#if 0
storeDirCloseSwapLogs();
-#endif
errorFree();
parseConfigFile(ConfigFile);
_db_init(Config.Log.log, Config.debugOptions);
break;
case COMM_SHUTDOWN:
/* delayed close so we can transmit while shutdown pending */
- if (theOutIcpConnection > 0) {
- comm_close(theOutIcpConnection);
- theOutIcpConnection = -1;
- }
+ icpConnectionClose();
+ snmpConnectionClose();
if (shutdown_pending) {
normal_shutdown();
#if 0
extern PF snmpHandleUdp;
extern void snmpInit(void);
extern void snmpConnectionOpen(void);
+extern void snmpConnectionShutdown(void);
extern void snmpConnectionClose(void);
extern int create_view(char **);
extern int create_user(char **);
extern void icpHandleIcpV3(int, struct sockaddr_in, char *, int);
extern int icpCheckUdpHit(StoreEntry *, request_t * request);
extern void icpConnectionsOpen(void);
-extern void icpConnectionsClose(void);
+extern void icpConnectionShutdown(void);
+extern void icpConnectionClose(void);
extern void ipcache_nbgethostbyname(const char *name,
IPH * handler,