--------------------- PatchSet 3542 Date: 2002/01/06 11:00:04 Author: serassio Branch: nt-2_3 Tag: (none) Log: Added print of Service command line in cache.log at startup, fixed some compile warnings in win32.c, added check of correct dll Authenticathor initialization, some indent fixes Members: src/authenticate.c:1.1.1.3.4.1.2.4->1.1.1.3.4.1.2.5 src/globals.h:1.1.1.3.4.2.2.5->1.1.1.3.4.2.2.6 src/main.c:1.1.1.3.4.2.2.12->1.1.1.3.4.2.2.13 src/win32.c:1.1.2.10->1.1.2.11 Index: squid/src/authenticate.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/authenticate.c,v retrieving revision 1.1.1.3.4.1.2.4 retrieving revision 1.1.1.3.4.1.2.5 diff -u -r1.1.1.3.4.1.2.4 -r1.1.1.3.4.1.2.5 --- squid/src/authenticate.c 10 Sep 2001 20:25:56 -0000 1.1.1.3.4.1.2.4 +++ squid/src/authenticate.c 6 Jan 2002 11:00:04 -0000 1.1.1.3.4.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.c,v 1.1.1.3.4.1.2.4 2001/09/10 20:25:56 serassio Exp $ + * $Id: authenticate.c,v 1.1.1.3.4.1.2.5 2002/01/06 11:00:04 serassio Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -44,24 +44,22 @@ static HLPCB authenticateHandleReply; static void authenticateStateFree(authenticateStateData * r); #ifdef _SQUID_MSWIN_ - typedef int ( * PFAuthenticate)(char *, char *, authenticateStateData *, HLPCB); - typedef int ( * PFInit)(char *); - - typedef struct { - HINSTANCE hnd; - PFAuthenticate Authenticate; - PFInit Init; - struct { - int requests; - int replies; - int queue_size; - int avg_svc_time; - } stats; - } AuthPlugin; - - static AuthPlugin *authenticators = NULL; +typedef int ( * PFAuthenticate)(char *, char *, authenticateStateData *, HLPCB); +typedef int ( * PFInit)(char *); +typedef struct { + HINSTANCE hnd; + PFAuthenticate Authenticate; + PFInit Init; + struct { + int requests; + int replies; + int queue_size; + int avg_svc_time; + } stats; +} AuthPlugin; +static AuthPlugin *authenticators = NULL; #else - static helper *authenticators = NULL; +static helper *authenticators = NULL; #endif static void @@ -172,8 +170,14 @@ return; } if (Config.Program.authenticate->next) { - debug(29, 0) ("authenticateInit: Initializing with group %s\n", Config.Program.authenticate->next->key); - authenticators->Init(Config.Program.authenticate->next->key); + debug(29, 0) ("authenticateInit: Initializing with Parameter: %s\n", Config.Program.authenticate->next->key); + if (authenticators->Init(Config.Program.authenticate->next->key)) { + debug(29, 0) ("authenticateInit: Failed Authenticator initialization\n"); + FreeLibrary(authenticators->hnd); + xfree(authenticators); + Config.Program.authenticate = NULL; + return; + } } else { debug(29, 0) ("authenticateInit: Missing auth plugin %s Parameter\n", Config.Program.authenticate->key); Index: squid/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/globals.h,v retrieving revision 1.1.1.3.4.2.2.5 retrieving revision 1.1.1.3.4.2.2.6 diff -u -r1.1.1.3.4.2.2.5 -r1.1.1.3.4.2.2.6 --- squid/src/globals.h 13 Aug 2001 17:09:17 -0000 1.1.1.3.4.2.2.5 +++ squid/src/globals.h 6 Jan 2002 11:00:05 -0000 1.1.1.3.4.2.2.6 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.1.1.3.4.2.2.5 2001/08/13 17:09:17 serassio Exp $ + * $Id: globals.h,v 1.1.1.3.4.2.2.6 2002/01/06 11:00:05 serassio Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -162,6 +162,7 @@ extern char *WIN32_OS_string; /* NULL */ extern char *WIN32_Service_name; /* NULL */ extern char *WIN32_Command_Line; /* NULL */ +extern char *WIN32_Service_Command_Line; /* NULL */ extern unsigned int WIN32_run_mode; /* _WIN_SQUID_RUN_MODE_INTERACTIVE */ #if defined(_SQUID_MSWIN_) && defined(_DEBUG) extern int do_debug; /* 0 */ Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.1.1.3.4.2.2.12 retrieving revision 1.1.1.3.4.2.2.13 diff -u -r1.1.1.3.4.2.2.12 -r1.1.1.3.4.2.2.13 --- squid/src/main.c 15 Sep 2001 12:15:19 -0000 1.1.1.3.4.2.2.12 +++ squid/src/main.c 6 Jan 2002 11:00:08 -0000 1.1.1.3.4.2.2.13 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.1.1.3.4.2.2.12 2001/09/15 12:15:19 serassio Exp $ + * $Id: main.c,v 1.1.1.3.4.2.2.13 2002/01/06 11:00:08 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -544,9 +544,11 @@ version_string, CONFIG_HOST_TYPE); #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) - if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { debug(1, 0) ("Running as %s Windows System Service on %s\n", WIN32_Service_name, WIN32_OS_string); + debug(1, 0) ("Service command line is: %s\n", WIN32_Service_Command_Line); + } else debug(1, 0) ("Running on %s\n",WIN32_OS_string); #endif Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/win32.c,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -r1.1.2.10 -r1.1.2.11 --- squid/src/win32.c 8 Dec 2001 08:39:01 -0000 1.1.2.10 +++ squid/src/win32.c 6 Jan 2002 11:00:11 -0000 1.1.2.11 @@ -67,7 +67,7 @@ #else #define CHANGESERVICECONFIG2 "ChangeServiceConfig2A" #endif -static SC_ACTION Squid_SCAction[1]= { SC_ACTION_RESTART, 60000 }; +static SC_ACTION Squid_SCAction[]= { { SC_ACTION_RESTART, 60000 } }; static SERVICE_DESCRIPTION Squid_ServiceDescription = {SOFTWARENAME " " SQUID_VERSION " WWW Proxy Server"}; static SERVICE_FAILURE_ACTIONS Squid_ServiceFailureActions = { 0, NULL, NULL, 1, Squid_SCAction }; static char REGKEY[256]="SOFTWARE\\"VENDOR"\\"SOFTWARENAME"\\"WIN32_VERSION"\\"; @@ -91,7 +91,7 @@ HKEY hKey; HKEY hKeyNext; int retval; - int rv; + LONG rv; hKey = HKEY_LOCAL_MACHINE; index = 0; @@ -105,13 +105,13 @@ NULL, /* class */ REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKeyNext, &result); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCreateKeyEx(%s),%d\n", keys[index], rv); + debug(1, 1) ("RegCreateKeyEx(%s),%d\n", keys[index], (int) rv); retval = -4; } /* Close the old key */ rv = RegCloseKey(hKey); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCloseKey %d\n", rv); + debug(1, 1) ("RegCloseKey %d\n", (int) rv); if (retval == 0) { /* Keep error status from RegCreateKeyEx, if any */ retval = -4; @@ -129,7 +129,7 @@ */ rv = RegCloseKey(hKey); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCloseKey %d\n", rv); + debug(1, 1) ("RegCloseKey %d\n", (int) rv); if (retval == 0) { /* Keep error status from RegCreateKeyEx, if any */ retval = -4; @@ -143,7 +143,7 @@ WIN32_StoreKey(const char *key, DWORD type, unsigned char *value, int value_size) { - long rv; + LONG rv; HKEY hKey; int retval; @@ -165,7 +165,7 @@ } } if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegOpenKeyEx HKLM\\%s, %d\n", REGKEY, rv); + debug(1, 1) ("RegOpenKeyEx HKLM\\%s, %d\n", REGKEY, (int) rv); return -4; } /* Now set the value and data */ @@ -176,7 +176,7 @@ (DWORD) value_size); /* for size of "value" */ retval = 0; /* Return value */ if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegQueryValueEx(key %s),%d\n", key, rv); + debug(1, 1) ("RegQueryValueEx(key %s),%d\n", key, (int) rv); retval = -4; } else { debug(1, 1) ("Registry stored HKLM\\%s\\%s value %s\n", @@ -189,7 +189,7 @@ */ rv = RegCloseKey(hKey); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCloseKey HKLM\\%s, %d\n", REGKEY, rv); + debug(1, 1) ("RegCloseKey HKLM\\%s, %d\n", REGKEY, (int) rv); if (retval == 0) { /* Keep error status from RegQueryValueEx, if any */ retval = -4; @@ -325,7 +325,6 @@ if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { char path[512]; HKEY hndKey; - char * CommandLine = NULL; if (signal(SIGABRT, WIN32_Abort) == SIG_ERR) return 1; /* Register the service Handler function */ @@ -359,17 +358,17 @@ Result = RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - CommandLine = xmalloc(Size); - RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, CommandLine, + WIN32_Service_Command_Line = xmalloc(Size); + RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, WIN32_Service_Command_Line, &Size); } else - CommandLine = xstrdup(""); + WIN32_Service_Command_Line = xstrdup(""); RegCloseKey(hndKey); } else { ConfigFile = xstrdup(DefaultConfigFile); - CommandLine = xstrdup(""); + WIN32_Service_Command_Line = xstrdup(""); } - WIN32_build_argv(CommandLine); + WIN32_build_argv(WIN32_Service_Command_Line); *argc = WIN32_argc; *argv = WIN32_argv; /* Set Service Staus to SERVICE_START_PENDING */