--------------------- PatchSet 865 Date: 2003/08/10 16:00:05 Author: serassio Branch: nt Tag: (none) Log: Forward IPC changes from nt-2.5 Members: src/ipc.cc:1.8.2.2->1.8.2.3 src/main.cc:1.15.2.22->1.15.2.23 Index: squid3/src/ipc.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipc.cc,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -u -r1.8.2.2 -r1.8.2.3 --- squid3/src/ipc.cc 9 Aug 2003 07:46:03 -0000 1.8.2.2 +++ squid3/src/ipc.cc 10 Aug 2003 16:00:05 -0000 1.8.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.8.2.2 2003/08/09 07:46:03 serassio Exp $ + * $Id: ipc.cc,v 1.8.2.3 2003/08/10 16:00:05 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -995,6 +995,7 @@ char buf1[8192]; STARTUPINFO si; PROCESS_INFORMATION pi; + long F; memset(&si, 0, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); @@ -1003,6 +1004,13 @@ si.hStdError = (HANDLE) _get_osfhandle(2); si.dwFlags = STARTF_USESTDHANDLES; + /* Make sure all other valid handles are not inerithable */ + for (int x = 3; x < SQUID_MAXFD; x++) { + if ((F = _get_osfhandle(x)) == -1) + continue; + SetHandleInformation((HANDLE) F, HANDLE_FLAG_INHERIT, 0); + } + *buf1 = '\0'; strcpy(buf1 + 4096, prog); char *str = strtok(buf1 + 4096, w_space); @@ -1823,7 +1831,7 @@ buf1[recvrv] = '\0'; - if (type == 2 && !strcmp(buf1, shutdown_string)) { + if (type == IPC_UDP_SOCKET && !strcmp(buf1, shutdown_string)) { debug(54, 3) ("ipc(%s,%d): request for shutdown received from parent. Exiting...\n", niceprog, pid); @@ -1870,7 +1878,7 @@ buf2[x] = '\0'; - if (type == 2 && !strcmp(buf2, ShutdownMessage)) { + if (type == IPC_UDP_SOCKET && !strcmp(buf2, ShutdownMessage)) { debug(54, 3) ("ipc(%s,%d): request for shutdown received. Exiting...\n", prog, pid); break; Index: squid3/src/main.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/main.cc,v retrieving revision 1.15.2.22 retrieving revision 1.15.2.23 diff -u -r1.15.2.22 -r1.15.2.23 --- squid3/src/main.cc 23 Jul 2003 13:18:59 -0000 1.15.2.22 +++ squid3/src/main.cc 10 Aug 2003 16:00:05 -0000 1.15.2.23 @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.15.2.22 2003/07/23 13:18:59 serassio Exp $ + * $Id: main.cc,v 1.15.2.23 2003/08/10 16:00:05 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -455,11 +455,7 @@ #endif clientdbInit(); -#ifndef _SQUID_MSWIN_ - icmpOpen(); -#endif - netdbInit(); asnInit(); ACL::Initialize(); @@ -551,10 +547,6 @@ idnsInit(); #endif -#ifdef _SQUID_MSWIN_ - - icmpOpen(); -#endif redirectInit(); authenticateInit(&Config.authConfiguration); @@ -577,10 +569,6 @@ mainRotate(void) { icmpClose(); -#ifdef _SQUID_MSWIN_ - - unlinkdClose(); -#endif #if USE_DNSSERVERS dnsShutdown(); @@ -609,10 +597,6 @@ redirectInit(); authenticateInit(&Config.authConfiguration); externalAclInit(); -#if defined(_SQUID_MSWIN_) && USE_UNLINKD - - unlinkdInit(); -#endif } static void @@ -773,12 +757,6 @@ #endif -#ifdef _SQUID_MSWIN_ - - icmpOpen(); - -#endif - if (!configured_once) { #if USE_UNLINKD unlinkdInit();