--------------------- PatchSet 696 Date: 2003/04/22 10:58:20 Author: serassio Branch: nt Tag: (none) Log: Changed daemon mode behaviour, win32 source cleanup Members: helpers/basic_auth/winbind/wb_basic_auth.c:1.4.2.1->1.4.2.2 include/profiling.h:1.6.2.2->1.6.2.3 src/Makefile.am:1.26.2.7->1.26.2.8 src/globals.h:1.9.2.4->1.9.2.5 src/main.cc:1.15.2.5->1.15.2.6 src/unlinkd.cc:1.7.2.1->1.7.2.2 src/win32.cc:1.4.2.4->1.4.2.5 Index: squid3/helpers/basic_auth/winbind/wb_basic_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid3/helpers/basic_auth/winbind/Attic/wb_basic_auth.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- squid3/helpers/basic_auth/winbind/wb_basic_auth.c 25 Feb 2003 02:48:21 -0000 1.4.2.1 +++ squid3/helpers/basic_auth/winbind/wb_basic_auth.c 22 Apr 2003 10:58:20 -0000 1.4.2.2 @@ -113,8 +113,8 @@ c=memchr(buf,'\n',BUFFER_SIZE); if (c) { - *c='\0'; - length=c-buf; + *c = '\0'; + length = c-buf; } else { err = 1; return; Index: squid3/include/profiling.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/profiling.h,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -u -r1.6.2.2 -r1.6.2.3 --- squid3/include/profiling.h 11 Mar 2003 08:26:48 -0000 1.6.2.2 +++ squid3/include/profiling.h 22 Apr 2003 10:58:21 -0000 1.6.2.3 @@ -13,7 +13,7 @@ #endif #if defined(__i386) -static inline hrtime_t +static inline hrtime_t get_tick(void) { hrtime_t regs; Index: squid3/src/Makefile.am =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Makefile.am,v retrieving revision 1.26.2.7 retrieving revision 1.26.2.8 diff -u -r1.26.2.7 -r1.26.2.8 --- squid3/src/Makefile.am 16 Mar 2003 11:09:17 -0000 1.26.2.7 +++ squid3/src/Makefile.am 22 Apr 2003 10:58:21 -0000 1.26.2.8 @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.26.2.7 2003/03/16 11:09:17 serassio Exp $ +# $Id: Makefile.am,v 1.26.2.8 2003/04/22 10:58:21 serassio Exp $ # # Uncomment and customize the following to suit your needs: # @@ -434,7 +434,8 @@ Store.cci \ String.cci \ SquidString.h \ - ufscommon.cci + ufscommon.cci \ + squid_windows.h nodist_squid_SOURCES = \ repl_modules.cc \ Index: squid3/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/globals.h,v retrieving revision 1.9.2.4 retrieving revision 1.9.2.5 diff -u -r1.9.2.4 -r1.9.2.5 --- squid3/src/globals.h 6 Apr 2003 13:08:52 -0000 1.9.2.4 +++ squid3/src/globals.h 22 Apr 2003 10:58:21 -0000 1.9.2.5 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.9.2.4 2003/04/06 13:08:52 serassio Exp $ + * $Id: globals.h,v 1.9.2.5 2003/04/22 10:58:21 serassio Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -182,6 +182,7 @@ extern int ssl_ex_index_server; /* -1 */ extern int ssl_ctx_ex_index_dont_verify_domain; /* -1 */ +extern int opt_no_daemon; /* 0 */ #ifdef __cplusplus } Index: squid3/src/main.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/main.cc,v retrieving revision 1.15.2.5 retrieving revision 1.15.2.6 diff -u -r1.15.2.5 -r1.15.2.6 --- squid3/src/main.cc 6 Apr 2003 13:08:52 -0000 1.15.2.5 +++ squid3/src/main.cc 22 Apr 2003 10:58:21 -0000 1.15.2.6 @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.15.2.5 2003/04/06 13:08:52 serassio Exp $ + * $Id: main.cc,v 1.15.2.6 2003/04/22 10:58:21 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -57,11 +57,6 @@ SQUIDCEXTERN void (*failure_notify) (const char *); static int opt_send_signal = -1; -#if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) -static int opt_no_daemon = 1; -#else -static int opt_no_daemon = 0; -#endif static int opt_parse_cfg_only = 0; static int icpPortNumOverride = 1; /* Want to detect "-u 0" */ static int configured_once = 0; @@ -129,9 +124,8 @@ " -C Do not catch fatal signals.\n" " -D Disable initial DNS tests.\n" " -F Don't serve any requests until store is rebuilt.\n" -#if !(defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_))) " -N No daemon mode.\n" -#else +#if (defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_))) " -O options\n" " Set Windows Service Command line options in Registry.\n" #endif @@ -152,7 +146,7 @@ #if defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)) - while ((c = getopt(argc, argv, "CDFO:RSVYXa:d:f:hik:m::n:rsu:vz?")) != -1) { + while ((c = getopt(argc, argv, "CDFNO:RSVYXa:d:f:hik:m::n:rsu:vz?")) != -1) { #else while ((c = getopt(argc, argv, "CDFNRSVYXa:d:f:hk:m::su:vz?")) != -1) { @@ -171,12 +165,11 @@ case 'F': opt_foreground_rebuild = 1; break; -#if !(defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_))) case 'N': opt_no_daemon = 1; break; -#else +#if (defined(USE_WIN32_SERVICE) && (defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_))) case 'O': opt_command_line = 1; Index: squid3/src/unlinkd.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/unlinkd.cc,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -r1.7.2.1 -r1.7.2.2 --- squid3/src/unlinkd.cc 25 Feb 2003 02:49:18 -0000 1.7.2.1 +++ squid3/src/unlinkd.cc 22 Apr 2003 10:58:21 -0000 1.7.2.2 @@ -1,6 +1,6 @@ /* - * $Id: unlinkd.cc,v 1.7.2.1 2003/02/25 02:49:18 hno Exp $ + * $Id: unlinkd.cc,v 1.7.2.2 2003/04/22 10:58:21 serassio Exp $ * * DEBUG: section 2 Unlink Daemon * AUTHOR: Duane Wessels @@ -206,19 +206,19 @@ } #else -if (unlinkd_wfd < 0) - return; + if (unlinkd_wfd < 0) + return; -debug(2, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd); + debug(2, 1) ("Closing unlinkd pipe on FD %d\n", unlinkd_wfd); -file_close(unlinkd_wfd); + file_close(unlinkd_wfd); -if (unlinkd_wfd != unlinkd_rfd) - file_close(unlinkd_rfd); + if (unlinkd_wfd != unlinkd_rfd) + file_close(unlinkd_rfd); -unlinkd_wfd = -1; + unlinkd_wfd = -1; -unlinkd_rfd = -1; + unlinkd_rfd = -1; #endif } @@ -227,6 +227,7 @@ unlinkdInit(void) { #ifdef USE_UNLINKD + const char *args[2]; struct timeval slp; @@ -263,19 +264,12 @@ #endif slp.tv_sec = 0; - slp.tv_usec = 250000; - select(0, NULL, NULL, NULL, &slp); - fd_note(unlinkd_wfd, "squid -> unlinkd"); - fd_note(unlinkd_rfd, "unlinkd -> squid"); - commSetTimeout(unlinkd_rfd, -1, NULL, NULL); - commSetTimeout(unlinkd_wfd, -1, NULL, NULL); - /* * unlinkd_rfd should already be non-blocking because of * ipcCreate. We change unlinkd_wfd to blocking mode because @@ -284,10 +278,8 @@ * do this only for the IPC_FIFO case. */ assert(fd_table[unlinkd_rfd].flags.nonblocking); - if (FD_PIPE == fd_table[unlinkd_wfd].type) commUnsetNonBlocking(unlinkd_wfd); - debug(2, 1) ("Unlinkd pipe opened on FD %d\n", unlinkd_wfd); #ifdef _SQUID_MSWIN_ @@ -297,9 +289,9 @@ #endif #else -debug(2, 1) ("Unlinkd is disabled\n"); + debug(2, 1) ("Unlinkd is disabled\n"); -#endif +#endif /* def USE_UNLINKD */ } #endif /* ndef UNLINK_DAEMON */ Index: squid3/src/win32.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/win32.cc,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -u -r1.4.2.4 -r1.4.2.5 --- squid3/src/win32.cc 20 Apr 2003 16:45:27 -0000 1.4.2.4 +++ squid3/src/win32.cc 22 Apr 2003 10:58:21 -0000 1.4.2.5 @@ -1,6 +1,6 @@ /* - * $Id: win32.cc,v 1.4.2.4 2003/04/20 16:45:27 serassio Exp $ + * $Id: win32.cc,v 1.4.2.5 2003/04/22 10:58:21 serassio Exp $ * * * * * * * * * Legal stuff * * * * * * * * @@ -867,6 +867,7 @@ if ((argc == 2) && strstr(argv[1], _WIN_SQUID_SERVICE_OPTION)) { WIN32_run_mode = _WIN_SQUID_RUN_MODE_SERVICE; + opt_no_daemon = 1; if (!(c=strchr(argv[1],':'))) { fprintf(stderr, "Bad Service Parameter: %s\n", argv[1]); @@ -885,6 +886,11 @@ } } else { WIN32_run_mode = _WIN_SQUID_RUN_MODE_INTERACTIVE; +#ifdef _SQUID_MSWIN_ + + opt_no_daemon = 1; + +#endif SquidMain(argc, argv); }