--------------------- PatchSet 3925 Date: 2002/04/06 17:37:34 Author: serassio Branch: nt-2_3 Tag: (none) Log: Multiple WIN32 Bug fixes Members: src/cache_manager.c:1.1.1.2.4.1.2.3->1.1.1.2.4.1.2.4 src/comm.c:1.1.1.3.4.1.2.9->1.1.1.3.4.1.2.10 src/main.c:1.1.1.3.4.2.2.13->1.1.1.3.4.2.2.14 src/store_dir_ufs.c:1.1.1.1.4.1.2.9->1.1.1.1.4.1.2.10 src/store_io_ufs.c:1.1.1.1.4.1.2.1->1.1.1.1.4.1.2.2 src/unlinkd.c:1.1.1.3.4.1.2.1->1.1.1.3.4.1.2.2 src/win32.c:1.1.2.14->1.1.2.15 Index: squid/src/cache_manager.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_manager.c,v retrieving revision 1.1.1.2.4.1.2.3 retrieving revision 1.1.1.2.4.1.2.4 diff -u -r1.1.1.2.4.1.2.3 -r1.1.1.2.4.1.2.4 --- squid/src/cache_manager.c 17 Feb 2002 08:57:57 -0000 1.1.1.2.4.1.2.3 +++ squid/src/cache_manager.c 6 Apr 2002 17:37:34 -0000 1.1.1.2.4.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: cache_manager.c,v 1.1.1.2.4.1.2.3 2002/02/17 08:57:57 serassio Exp $ + * $Id: cache_manager.c,v 1.1.1.2.4.1.2.4 2002/04/06 17:37:34 serassio Exp $ * * DEBUG: section 16 Cache Manager Objects * AUTHOR: Duane Wessels @@ -64,6 +64,9 @@ static const char *cachemgrActionProtection(const action_table * at); static OBJH cachemgrShutdown; static OBJH cachemgrReconfigure; +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) +static OBJH cachemgrBreak; +#endif static OBJH cachemgrMenu; static OBJH cachemgrOfflineToggle; @@ -290,6 +293,16 @@ storeAppendPrintf(sentry, "Reconfiguring Squid Process ...."); } +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) +static void +cachemgrBreak(StoreEntry * sentry) +{ + debug(16, 0) ("Break by command.\n"); + sigusr2_handle(SIGUSR2); + storeAppendPrintf(sentry, "Breaking Squid Process ...."); +} +#endif + static void cachemgrOfflineToggle(StoreEntry * sentry) { @@ -362,6 +375,11 @@ cachemgrRegister("reconfigure", "Reconfigure the Squid Process", cachemgrReconfigure, 1, 1); +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) + cachemgrRegister("break", + "Break the Squid Process", + cachemgrBreak, 1, 1); +#endif cachemgrRegister("offline_toggle", "Toggle offline_mode setting", cachemgrOfflineToggle, 1, 1); Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.1.1.3.4.1.2.9 retrieving revision 1.1.1.3.4.1.2.10 diff -u -r1.1.1.3.4.1.2.9 -r1.1.1.3.4.1.2.10 --- squid/src/comm.c 3 Feb 2002 15:15:35 -0000 1.1.1.3.4.1.2.9 +++ squid/src/comm.c 6 Apr 2002 17:37:38 -0000 1.1.1.3.4.1.2.10 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.1.1.3.4.1.2.9 2002/02/03 15:15:35 serassio Exp $ + * $Id: comm.c,v 1.1.1.3.4.1.2.10 2002/04/06 17:37:38 serassio Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -721,9 +721,9 @@ assert(fd >= 0); assert(fd < Squid_MaxFD); #ifdef _SQUID_MSWIN_ - F = &sd_table[fd]; + F = &sd_table[fd]; #else - F = &fd_table[fd]; + F = &fd_table[fd]; #endif if (F->flags.closing) return; @@ -927,7 +927,7 @@ { int dummy = 0; #ifdef _SQUID_MSWIN_ - int nonblocking=0; + int nonblocking=0; if (ioctlsocket(fd, FIONBIO, (unsigned long*)&nonblocking) ==SOCKET_ERROR) { debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, wsastrerror(WSAGetLastError())); return COMM_ERROR; Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.1.1.3.4.2.2.13 retrieving revision 1.1.1.3.4.2.2.14 diff -u -r1.1.1.3.4.2.2.13 -r1.1.1.3.4.2.2.14 --- squid/src/main.c 6 Jan 2002 11:00:08 -0000 1.1.1.3.4.2.2.13 +++ squid/src/main.c 6 Apr 2002 17:37:39 -0000 1.1.1.3.4.2.2.14 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.1.1.3.4.2.2.13 2002/01/06 11:00:08 serassio Exp $ + * $Id: main.c,v 1.1.1.3.4.2.2.14 2002/04/06 17:37:39 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -445,8 +445,8 @@ mainRotate(void) { icmpClose(); -#ifdef _SQUID_MSWIN_ unlinkdClose(); +#ifdef _SQUID_MSWIN_ redirectShutdown(); authenticateShutdown(); #if USE_DNSSERVERS @@ -464,8 +464,8 @@ #endif authenticateInit(); redirectInit(); - unlinkdInit(); #endif + unlinkdInit(); icmpOpen(); } @@ -554,6 +554,9 @@ #endif debug(1, 1) ("Process ID %d\n", (int) getpid()); debug(1, 1) ("With %d file descriptors available\n", Squid_MaxFD); +#ifdef _SQUID_MSWIN_ + debug(1, 1) ("With %d CRT stdio descriptors available\n", _getmaxstdio()); +#endif if (!configured_once) disk_init(); /* disk_init must go before ipcache_init() */ @@ -827,7 +830,7 @@ #if defined(_SQUID_MSWIN_) && defined(_DEBUG) } else if (do_debug) { do_debug = 0; - DebugBreak(); + __asm int 3; #endif } else if (do_rotate) { mainRotate(); @@ -899,15 +902,21 @@ WIN32_sendSignal(opt_send_signal); else { #endif +#ifdef _SQUID_MSWIN_ + fprintf(stderr, "%s: ERROR: Could not send ", appname); + fprintf(stderr, "signal to Squid Service:\n"); + fprintf(stderr, "missing -n command line switch.\n"); +#else if (kill(pid, opt_send_signal) && /* ignore permissions if just running check */ !(opt_send_signal == 0 && errno == EPERM)) { fprintf(stderr, "%s: ERROR: Could not send ", appname); fprintf(stderr, "signal %d to process %d: %s\n", opt_send_signal, (int) pid, xstrerror()); +#endif exit(1); } -#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) +#if defined(USE_WIN32_SERVICE) && defined(_SQUID_CYGWIN_) } #endif } else { Index: squid/src/store_dir_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/store_dir_ufs.c,v retrieving revision 1.1.1.1.4.1.2.9 retrieving revision 1.1.1.1.4.1.2.10 diff -u -r1.1.1.1.4.1.2.9 -r1.1.1.1.4.1.2.10 --- squid/src/store_dir_ufs.c 1 Sep 2001 10:46:22 -0000 1.1.1.1.4.1.2.9 +++ squid/src/store_dir_ufs.c 6 Apr 2002 17:37:39 -0000 1.1.1.1.4.1.2.10 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.c,v 1.1.1.1.4.1.2.9 2001/09/01 10:46:22 serassio Exp $ + * $Id: store_dir_ufs.c,v 1.1.1.1.4.1.2.10 2002/04/06 17:37:39 serassio Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -899,6 +899,7 @@ safe_free(state); sd->log.clean.state = NULL; sd->log.clean.write = NULL; + return; } state->outbuf_offset = 0; } Index: squid/src/store_io_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/store_io_ufs.c,v retrieving revision 1.1.1.1.4.1.2.1 retrieving revision 1.1.1.1.4.1.2.2 diff -u -r1.1.1.1.4.1.2.1 -r1.1.1.1.4.1.2.2 --- squid/src/store_io_ufs.c 6 Jan 2001 12:40:16 -0000 1.1.1.1.4.1.2.1 +++ squid/src/store_io_ufs.c 6 Apr 2002 17:37:39 -0000 1.1.1.1.4.1.2.2 @@ -1,6 +1,6 @@ /* - * $Id: store_io_ufs.c,v 1.1.1.1.4.1.2.1 2001/01/06 12:40:16 hno Exp $ + * $Id: store_io_ufs.c,v 1.1.1.1.4.1.2.2 2002/04/06 17:37:39 serassio Exp $ * * DEBUG: section 79 Storage Manager UFS Interface * AUTHOR: Duane Wessels @@ -126,7 +126,11 @@ storeUfsUnlink(sfileno f) { debug(79, 3) ("storeUfsUnlink: fileno %08X\n", f); +#if USE_UNLINKD unlinkdUnlink(storeUfsFullPath(f, NULL)); +#else + unlink(storeUfsFullPath(f, NULL)); +#endif } /* === STATIC =========================================================== */ Index: squid/src/unlinkd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/unlinkd.c,v retrieving revision 1.1.1.3.4.1.2.1 retrieving revision 1.1.1.3.4.1.2.2 diff -u -r1.1.1.3.4.1.2.1 -r1.1.1.3.4.1.2.2 --- squid/src/unlinkd.c 6 Jan 2001 12:40:17 -0000 1.1.1.3.4.1.2.1 +++ squid/src/unlinkd.c 6 Apr 2002 17:37:39 -0000 1.1.1.3.4.1.2.2 @@ -1,5 +1,5 @@ /* - * $Id: unlinkd.c,v 1.1.1.3.4.1.2.1 2001/01/06 12:40:17 hno Exp $ + * $Id: unlinkd.c,v 1.1.1.3.4.1.2.2 2002/04/06 17:37:39 serassio Exp $ * * DEBUG: section 12 Unlink Daemon * AUTHOR: Duane Wessels @@ -161,7 +161,6 @@ void unlinkdInit(void) { -#ifndef _SQUID_MSWIN_ #if USE_UNLINKD int x; char *args[2]; @@ -202,7 +201,6 @@ #else debug(12, 1) ("Unlinkd is disabled\n"); #endif -#endif } #endif /* ndef UNLINK_DAEMON */ Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/win32.c,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -u -r1.1.2.14 -r1.1.2.15 --- squid/src/win32.c 3 Mar 2002 10:14:07 -0000 1.1.2.14 +++ squid/src/win32.c 6 Apr 2002 17:37:39 -0000 1.1.2.15 @@ -384,6 +384,9 @@ svcStatus.dwCheckPoint = 0; svcStatus.dwWaitHint = 10000; SetServiceStatus(svcHandle, &svcStatus); +#ifdef _SQUID_MSWIN_ + _setmaxstdio(Squid_MaxFD); +#endif } #endif #ifdef _SQUID_MSWIN_