--------------------- PatchSet 5090 Date: 2002/09/22 11:38:05 Author: serassio Branch: nt-2_5 Tag: (none) Log: WIN32 code cleanup from nt branch Members: helpers/basic_auth/win32_locallogon/valid.c:1.1.4.1->1.1.4.2 helpers/external_acl/win32_group/win32_check_group.c:1.1.8.6->1.1.8.7 helpers/external_acl/win32_group/win32_check_group.h:1.1.6.1->1.1.6.2 helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c:1.1.4.1->1.1.4.2 helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c:1.1.4.3->1.1.4.4 lib/sspwin32.c:1.1.4.1->1.1.4.2 lib/win32lib.c:1.1.32.8->1.1.32.9 snmplib/parse.c:1.2.14.2->1.2.14.3 src/comm.c:1.18.6.1.2.7->1.18.6.1.2.8 src/debug.c:1.9.10.5->1.9.10.6 src/ipc.c:1.7.10.6->1.7.10.7 src/main.c:1.28.6.1.4.10->1.28.6.1.4.11 src/fs/awin32/aiops.c:1.1.62.8->1.1.62.9 src/fs/ufs/store_dir_ufs.c:1.21.6.1.4.10->1.21.6.1.4.11 Index: squid/helpers/basic_auth/win32_locallogon/valid.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/basic_auth/win32_locallogon/Attic/valid.c,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -r1.1.4.1 -r1.1.4.2 --- squid/helpers/basic_auth/win32_locallogon/valid.c 29 Jun 2002 11:05:59 -0000 1.1.4.1 +++ squid/helpers/basic_auth/win32_locallogon/valid.c 22 Sep 2002 11:40:25 -0000 1.1.4.2 @@ -31,7 +31,6 @@ /* Check if we try to compile on a Windows Platform */ #if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) -#include #if defined(_SQUID_CYGWIN_) #include #endif @@ -87,7 +86,6 @@ if (nStatus == NERR_Success) { if ((pTmpBuf = pBuf) != NULL) { for (i = 0; i < dwEntriesRead; i++) { - assert(pTmpBuf != NULL); if (pTmpBuf == NULL) { result = FALSE; break; Index: squid/helpers/external_acl/win32_group/win32_check_group.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/win32_group/Attic/win32_check_group.c,v retrieving revision 1.1.8.6 retrieving revision 1.1.8.7 diff -u -r1.1.8.6 -r1.1.8.7 --- squid/helpers/external_acl/win32_group/win32_check_group.c 8 Sep 2002 08:20:30 -0000 1.1.8.6 +++ squid/helpers/external_acl/win32_group/win32_check_group.c 22 Sep 2002 11:40:25 -0000 1.1.8.7 @@ -1,5 +1,5 @@ /* - * $Id: win32_check_group.c,v 1.1.8.6 2002/09/08 08:20:30 serassio Exp $ + * $Id: win32_check_group.c,v 1.1.8.7 2002/09/22 11:40:25 serassio Exp $ * * This is a helper for the external ACL interface for Squid Cache * Copyright (C) 2002 Guido Serassio @@ -45,7 +45,7 @@ #include "win32_check_group.h" -static char * +char * strwordtok(char *buf, char **t) { unsigned char *word = NULL; @@ -155,7 +155,7 @@ * Error checking. */ if (status) { - debug("OpenPolicy Error: %d\n", status); + debug("OpenPolicy Error: %ld\n", status); } else { /* @@ -166,7 +166,7 @@ PolicyPrimaryDomainInformation, (PVOID *)&ppdiDomainInfo); if (status) { - debug("LsaQueryInformationPolicy Error: %d\n", status); + debug("LsaQueryInformationPolicy Error: %ld\n", status); } else { /* Get name in useable format */ @@ -196,7 +196,7 @@ NetApiBufferFree(pwkiWorkstationInfo); LsaFreeMemory((LPVOID)ppdiDomainInfo); } else - debug("NetWkstaGetInfo Error: %d\n", netret); + debug("NetWkstaGetInfo Error: %ld\n", netret); return DomainName; } Index: squid/helpers/external_acl/win32_group/win32_check_group.h =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/win32_group/Attic/win32_check_group.h,v retrieving revision 1.1.6.1 retrieving revision 1.1.6.2 diff -u -r1.1.6.1 -r1.1.6.2 --- squid/helpers/external_acl/win32_group/win32_check_group.h 16 Jul 2002 09:37:36 -0000 1.1.6.1 +++ squid/helpers/external_acl/win32_group/win32_check_group.h 22 Sep 2002 11:40:25 -0000 1.1.6.2 @@ -75,4 +75,3 @@ /* no gcc, no debugging. varargs macros are a gcc extension */ #define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); #endif - Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/ntlm_auth/NTLMSSP-WIN32/Attic/libntlmssp.c,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -r1.1.4.1 -r1.1.4.2 --- squid/helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c 29 Jun 2002 11:05:59 -0000 1.1.4.1 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/libntlmssp.c 22 Sep 2002 11:40:25 -0000 1.1.4.2 @@ -18,7 +18,6 @@ #include "squid.h" #include "ntlm.h" -#include #include #include @@ -79,7 +78,6 @@ if (nStatus == NERR_Success) { if ((pTmpBuf = pBuf) != NULL) { for (i = 0; i < dwEntriesRead; i++) { - assert(pTmpBuf != NULL); if (pTmpBuf == NULL) { result = FALSE; break; @@ -184,7 +182,7 @@ * Error checking. */ if (status) { - debug("OpenPolicy Error: %d\n", status); + debug("OpenPolicy Error: %ld\n", status); } else { /* @@ -193,9 +191,9 @@ */ status = LsaQueryInformationPolicy(PolicyHandle, PolicyPrimaryDomainInformation, - &ppdiDomainInfo); + (void **)&ppdiDomainInfo); if (status) { - debug("LsaQueryInformationPolicy Error: %d\n", status); + debug("LsaQueryInformationPolicy Error: %ld\n", status); } else { /* Get name in useable format */ @@ -225,7 +223,7 @@ NetApiBufferFree(pwkiWorkstationInfo); LsaFreeMemory((LPVOID)ppdiDomainInfo); } else - debug("NetWkstaGetInfo Error: %d\n", netret); + debug("NetWkstaGetInfo Error: %ld\n", netret); return DomainName; } Index: squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/ntlm_auth/NTLMSSP-WIN32/Attic/ntlm_auth.c,v retrieving revision 1.1.4.3 retrieving revision 1.1.4.4 diff -u -r1.1.4.3 -r1.1.4.4 --- squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c 11 Aug 2002 16:44:07 -0000 1.1.4.3 +++ squid/helpers/ntlm_auth/NTLMSSP-WIN32/ntlm_auth.c 22 Sep 2002 11:40:26 -0000 1.1.4.4 @@ -1,5 +1,5 @@ /* - * $Id: ntlm_auth.c,v 1.1.4.3 2002/08/11 16:44:07 serassio Exp $ + * $Id: ntlm_auth.c,v 1.1.4.4 2002/09/22 11:40:26 serassio Exp $ * * This is a helper for NTLM Authentication for Squid Cache * Copyright (C) 2002 Guido Serassio @@ -174,7 +174,6 @@ const char * obtain_challenge() { - int j = 0; const char *ch = NULL; debug("attempting challenge retrieval\n"); Index: squid/lib/sspwin32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/lib/sspwin32.c,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -r1.1.4.1 -r1.1.4.2 --- squid/lib/sspwin32.c 16 Jul 2002 12:46:50 -0000 1.1.4.1 +++ squid/lib/sspwin32.c 22 Sep 2002 11:39:41 -0000 1.1.4.2 @@ -18,8 +18,6 @@ #include "squid.h" #include "sspwin32.h" - - typedef struct _AUTH_SEQ { BOOL fInitialized; BOOL fHaveCredHandle; @@ -105,7 +103,7 @@ if (!_AcquireCredentialsHandle) { UnloadSecurityDll(); hModule = NULL; - return hModule; + return hModule; } /* CompleteAuthToken is not present on Windows 9x Secur32.dll * Do not check for the availablity of the function if it is NULL @@ -117,21 +115,21 @@ if (!_DeleteSecurityContext) { UnloadSecurityDll(); hModule = NULL; - return hModule; + return hModule; } _FreeContextBuffer = (FREE_CONTEXT_BUFFER_FN) GetProcAddress(hModule, "FreeContextBuffer"); - if (!_FreeContextBuffer) { - UnloadSecurityDll(); - hModule = NULL; - return hModule; + if (!_FreeContextBuffer) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; } _FreeCredentialsHandle = (FREE_CREDENTIALS_HANDLE_FN) GetProcAddress(hModule, "FreeCredentialsHandle"); - if (!_FreeCredentialsHandle) { - UnloadSecurityDll(); - hModule = NULL; - return hModule; + if (!_FreeCredentialsHandle) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; } #ifdef UNICODE _InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN) @@ -140,10 +138,10 @@ _InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN) GetProcAddress(hModule, "InitializeSecurityContextA"); #endif - if (!_InitializeSecurityContext) { - UnloadSecurityDll(); - hModule = NULL; - return hModule; + if (!_InitializeSecurityContext) { + UnloadSecurityDll(); + hModule = NULL; + return hModule; } #ifdef UNICODE _QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN) @@ -152,9 +150,9 @@ _QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN) GetProcAddress(hModule, "QuerySecurityPackageInfoA"); #endif - if (!_QuerySecurityPackageInfo) { - UnloadSecurityDll(); - hModule = NULL; + if (!_QuerySecurityPackageInfo) { + UnloadSecurityDll(); + hModule = NULL; } return hModule; } @@ -185,7 +183,7 @@ SECPKG_CRED_OUTBOUND, NULL, (NTLM_mode == SSP_NTLM) ? NULL : pAuthIdentity, NULL, NULL, &pAS->hcred, &tsExpiry); if (ss < 0) { - fprintf(stderr, "AcquireCredentialsHandle failed with %08X\n", ss); + fprintf(stderr, "AcquireCredentialsHandle failed with %08lX\n", ss); return FALSE; } pAS->fHaveCredHandle = TRUE; @@ -214,7 +212,7 @@ 0, &pAS->hctxt, &sbdOut, &fContextAttr, &tsExpiry); if (ss < 0) { // - fprintf(stderr, "InitializeSecurityContext failed with %08X\n", ss); + fprintf(stderr, "InitializeSecurityContext failed with %08lX\n", ss); return FALSE; } pAS->fHaveCtxtHandle = TRUE; @@ -224,7 +222,7 @@ if (_CompleteAuthToken) { ss = _CompleteAuthToken(&pAS->hctxt, &sbdOut); if (ss < 0) { - fprintf(stderr, "CompleteAuthToken failed with %08X\n", ss); + fprintf(stderr, "CompleteAuthToken failed with %08lX\n", ss); return FALSE; } } else { @@ -268,7 +266,7 @@ SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, &pAS->hcred, &tsExpiry); if (ss < 0) { - fprintf(stderr, "AcquireCredentialsHandle failed with %08X\n", ss); + fprintf(stderr, "AcquireCredentialsHandle failed with %08lX\n", ss); return FALSE; } pAS->fHaveCredHandle = TRUE; @@ -294,7 +292,7 @@ SECURITY_NATIVE_DREP, &pAS->hctxt, &sbdOut, &fContextAttr, &tsExpiry); if (ss < 0) { - fprintf(stderr, "AcceptSecurityContext failed with %08X\n", ss); + fprintf(stderr, "AcceptSecurityContext failed with %08lX\n", ss); return FALSE; } pAS->fHaveCtxtHandle = TRUE; @@ -304,7 +302,7 @@ if (_CompleteAuthToken) { ss = _CompleteAuthToken(&pAS->hctxt, &sbdOut); if (ss < 0) { - fprintf(stderr, "CompleteAuthToken failed with %08X\n", ss); + fprintf(stderr, "CompleteAuthToken failed with %08lX\n", ss); return FALSE; } } else { @@ -393,7 +391,7 @@ &fDone)) break; fResult = TRUE; - } while(0); + } while(0); /* Clean up resources */ if (asClient.fHaveCtxtHandle) @@ -406,6 +404,6 @@ _FreeCredentialsHandle(&asServer.hcred); xfree(pClientBuf); xfree(pServerBuf); - + return fResult; } Index: squid/lib/win32lib.c =================================================================== RCS file: /cvsroot/squid-sf//squid/lib/win32lib.c,v retrieving revision 1.1.32.8 retrieving revision 1.1.32.9 diff -u -r1.1.32.8 -r1.1.32.9 --- squid/lib/win32lib.c 12 Sep 2002 18:33:25 -0000 1.1.32.8 +++ squid/lib/win32lib.c 22 Sep 2002 11:39:41 -0000 1.1.32.9 @@ -1,5 +1,5 @@ /* - * $Id: win32lib.c,v 1.1.32.8 2002/09/12 18:33:25 serassio Exp $ + * $Id: win32lib.c,v 1.1.32.9 2002/09/22 11:39:41 serassio Exp $ * * * * * * * * * Legal stuff * * * * * * * * @@ -339,64 +339,64 @@ const char *errconst; const char *errdesc; } _wsaerrtext[] = { -WSA_E_CANCELLED,"WSA_E_CANCELLED","Lookup cancelled.", -WSA_E_NO_MORE,"WSA_E_NO_MORE","No more data available.", -WSAEACCES,"WSAEACCES","Permission denied.", -WSAEADDRINUSE,"WSAEADDRINUSE","Address already in use.", -WSAEADDRNOTAVAIL,"WSAEADDRNOTAVAIL","Cannot assign requested address.", -WSAEAFNOSUPPORT,"WSAEAFNOSUPPORT","Address family not supported by protocol family.", -WSAEALREADY,"WSAEALREADY","Operation already in progress.", -WSAEBADF,"WSAEBADF","Bad file number.", -WSAECANCELLED,"WSAECANCELLED","Operation cancelled.", -WSAECONNABORTED,"WSAECONNABORTED","Software caused connection abort.", -WSAECONNREFUSED,"WSAECONNREFUSED","Connection refused.", -WSAECONNRESET,"WSAECONNRESET","Connection reset by peer.", -WSAEDESTADDRREQ,"WSAEDESTADDRREQ","Destination address required.", -WSAEDQUOT,"WSAEDQUOT","Disk quota exceeded.", -WSAEFAULT,"WSAEFAULT","Bad address.", -WSAEHOSTDOWN,"WSAEHOSTDOWN","Host is down.", -WSAEHOSTUNREACH,"WSAEHOSTUNREACH","No route to host.", -WSAEINPROGRESS,"WSAEINPROGRESS","Operation now in progress.", -WSAEINTR,"WSAEINTR","Interrupted function call.", -WSAEINVAL,"WSAEINVAL","Invalid argument.", -WSAEINVALIDPROCTABLE,"WSAEINVALIDPROCTABLE","Invalid procedure table from service provider.", -WSAEINVALIDPROVIDER,"WSAEINVALIDPROVIDER","Invalid service provider version number.", -WSAEISCONN,"WSAEISCONN","Socket is already connected.", -WSAELOOP,"WSAELOOP","Too many levels of symbolic links.", -WSAEMFILE,"WSAEMFILE","Too many open files.", -WSAEMSGSIZE,"WSAEMSGSIZE","Message too long.", -WSAENAMETOOLONG,"WSAENAMETOOLONG","File name is too long.", -WSAENETDOWN,"WSAENETDOWN","Network is down.", -WSAENETRESET,"WSAENETRESET","Network dropped connection on reset.", -WSAENETUNREACH,"WSAENETUNREACH","Network is unreachable.", -WSAENOBUFS,"WSAENOBUFS","No buffer space available.", -WSAENOMORE,"WSAENOMORE","No more data available.", -WSAENOPROTOOPT,"WSAENOPROTOOPT","Bad protocol option.", -WSAENOTCONN,"WSAENOTCONN","Socket is not connected.", -WSAENOTEMPTY,"WSAENOTEMPTY","Directory is not empty.", -WSAENOTSOCK,"WSAENOTSOCK","Socket operation on nonsocket.", -WSAEOPNOTSUPP,"WSAEOPNOTSUPP","Operation not supported.", -WSAEPFNOSUPPORT,"WSAEPFNOSUPPORT","Protocol family not supported.", -WSAEPROCLIM,"WSAEPROCLIM","Too many processes.", -WSAEPROTONOSUPPORT,"WSAEPROTONOSUPPORT","Protocol not supported.", -WSAEPROTOTYPE,"WSAEPROTOTYPE","Protocol wrong type for socket.", -WSAEPROVIDERFAILEDINIT,"WSAEPROVIDERFAILEDINIT","Unable to initialise a service provider.", -WSAEREFUSED,"WSAEREFUSED","Refused.", -WSAEREMOTE,"WSAEREMOTE","Too many levels of remote in path.", -WSAESHUTDOWN,"WSAESHUTDOWN","Cannot send after socket shutdown.", -WSAESOCKTNOSUPPORT,"WSAESOCKTNOSUPPORT","Socket type not supported.", -WSAESTALE,"WSAESTALE","Stale NFS file handle.", -WSAETIMEDOUT,"WSAETIMEDOUT","Connection timed out.", -WSAETOOMANYREFS,"WSAETOOMANYREFS","Too many references.", -WSAEUSERS,"WSAEUSERS","Too many users.", -WSAEWOULDBLOCK,"WSAEWOULDBLOCK","Resource temporarily unavailable.", -WSANOTINITIALISED,"WSANOTINITIALISED","Successful WSAStartup not yet performed.", -WSASERVICE_NOT_FOUND,"WSASERVICE_NOT_FOUND","Service not found.", -WSASYSCALLFAILURE,"WSASYSCALLFAILURE","System call failure.", -WSASYSNOTREADY,"WSASYSNOTREADY","Network subsystem is unavailable.", -WSATYPE_NOT_FOUND,"WSATYPE_NOT_FOUND","Class type not found.", -WSAVERNOTSUPPORTED,"WSAVERNOTSUPPORTED","Winsock.dll version out of range.", -WSAEDISCON,"WSAEDISCON","Graceful shutdown in progress." + {WSA_E_CANCELLED, "WSA_E_CANCELLED", "Lookup cancelled."}, + {WSA_E_NO_MORE, "WSA_E_NO_MORE", "No more data available."}, + {WSAEACCES, "WSAEACCES", "Permission denied."}, + {WSAEADDRINUSE, "WSAEADDRINUSE", "Address already in use."}, + {WSAEADDRNOTAVAIL, "WSAEADDRNOTAVAIL", "Cannot assign requested address."}, + {WSAEAFNOSUPPORT, "WSAEAFNOSUPPORT", "Address family not supported by protocol family."}, + {WSAEALREADY, "WSAEALREADY", "Operation already in progress."}, + {WSAEBADF, "WSAEBADF", "Bad file number."}, + {WSAECANCELLED, "WSAECANCELLED", "Operation cancelled."}, + {WSAECONNABORTED, "WSAECONNABORTED", "Software caused connection abort."}, + {WSAECONNREFUSED, "WSAECONNREFUSED", "Connection refused."}, + {WSAECONNRESET, "WSAECONNRESET", "Connection reset by peer."}, + {WSAEDESTADDRREQ, "WSAEDESTADDRREQ", "Destination address required."}, + {WSAEDQUOT, "WSAEDQUOT", "Disk quota exceeded."}, + {WSAEFAULT, "WSAEFAULT", "Bad address."}, + {WSAEHOSTDOWN, "WSAEHOSTDOWN", "Host is down."}, + {WSAEHOSTUNREACH, "WSAEHOSTUNREACH", "No route to host."}, + {WSAEINPROGRESS, "WSAEINPROGRESS", "Operation now in progress."}, + {WSAEINTR, "WSAEINTR", "Interrupted function call."}, + {WSAEINVAL, "WSAEINVAL", "Invalid argument."}, + {WSAEINVALIDPROCTABLE, "WSAEINVALIDPROCTABLE", "Invalid procedure table from service provider."}, + {WSAEINVALIDPROVIDER, "WSAEINVALIDPROVIDER", "Invalid service provider version number."}, + {WSAEISCONN, "WSAEISCONN", "Socket is already connected."}, + {WSAELOOP, "WSAELOOP", "Too many levels of symbolic links."}, + {WSAEMFILE, "WSAEMFILE", "Too many open files."}, + {WSAEMSGSIZE, "WSAEMSGSIZE", "Message too long."}, + {WSAENAMETOOLONG, "WSAENAMETOOLONG", "File name is too long."}, + {WSAENETDOWN, "WSAENETDOWN", "Network is down."}, + {WSAENETRESET, "WSAENETRESET", "Network dropped connection on reset."}, + {WSAENETUNREACH, "WSAENETUNREACH", "Network is unreachable."}, + {WSAENOBUFS, "WSAENOBUFS", "No buffer space available."}, + {WSAENOMORE, "WSAENOMORE", "No more data available."}, + {WSAENOPROTOOPT, "WSAENOPROTOOPT", "Bad protocol option."}, + {WSAENOTCONN, "WSAENOTCONN", "Socket is not connected."}, + {WSAENOTEMPTY, "WSAENOTEMPTY", "Directory is not empty."}, + {WSAENOTSOCK, "WSAENOTSOCK", "Socket operation on nonsocket."}, + {WSAEOPNOTSUPP, "WSAEOPNOTSUPP", "Operation not supported."}, + {WSAEPFNOSUPPORT, "WSAEPFNOSUPPORT", "Protocol family not supported."}, + {WSAEPROCLIM, "WSAEPROCLIM", "Too many processes."}, + {WSAEPROTONOSUPPORT, "WSAEPROTONOSUPPORT", "Protocol not supported."}, + {WSAEPROTOTYPE, "WSAEPROTOTYPE", "Protocol wrong type for socket."}, + {WSAEPROVIDERFAILEDINIT, "WSAEPROVIDERFAILEDINIT", "Unable to initialise a service provider."}, + {WSAEREFUSED, "WSAEREFUSED", "Refused."}, + {WSAEREMOTE, "WSAEREMOTE", "Too many levels of remote in path."}, + {WSAESHUTDOWN, "WSAESHUTDOWN", "Cannot send after socket shutdown."}, + {WSAESOCKTNOSUPPORT, "WSAESOCKTNOSUPPORT", "Socket type not supported."}, + {WSAESTALE, "WSAESTALE", "Stale NFS file handle."}, + {WSAETIMEDOUT, "WSAETIMEDOUT", "Connection timed out."}, + {WSAETOOMANYREFS, "WSAETOOMANYREFS", "Too many references."}, + {WSAEUSERS, "WSAEUSERS", "Too many users."}, + {WSAEWOULDBLOCK, "WSAEWOULDBLOCK", "Resource temporarily unavailable."}, + {WSANOTINITIALISED, "WSANOTINITIALISED", "Successful WSAStartup not yet performed."}, + {WSASERVICE_NOT_FOUND, "WSASERVICE_NOT_FOUND", "Service not found."}, + {WSASYSCALLFAILURE, "WSASYSCALLFAILURE", "System call failure."}, + {WSASYSNOTREADY, "WSASYSNOTREADY", "Network subsystem is unavailable."}, + {WSATYPE_NOT_FOUND, "WSATYPE_NOT_FOUND", "Class type not found."}, + {WSAVERNOTSUPPORTED, "WSAVERNOTSUPPORTED", "Winsock.dll version out of range."}, + {WSAEDISCON, "WSAEDISCON", "Graceful shutdown in progress."} }; /* @@ -408,10 +408,10 @@ static char xwsaerror_buf[BUFSIZ]; int i, errind = -1; - if ( err == 0 ) + if (err == 0) return "(0) No error."; - for ( i = 0; i < sizeof(_wsaerrtext)/sizeof(struct _wsaerrtext); i++ ) { - if ( _wsaerrtext[i].err != err ) + for (i = 0; i < sizeof(_wsaerrtext)/sizeof(struct _wsaerrtext); i++) { + if (_wsaerrtext[i].err != err) continue; errind = i; break; Index: squid/snmplib/parse.c =================================================================== RCS file: /cvsroot/squid-sf//squid/snmplib/parse.c,v retrieving revision 1.2.14.2 retrieving revision 1.2.14.3 diff -u -r1.2.14.2 -r1.2.14.3 --- squid/snmplib/parse.c 23 Mar 2002 10:35:25 -0000 1.2.14.2 +++ squid/snmplib/parse.c 22 Sep 2002 11:39:29 -0000 1.2.14.3 @@ -108,11 +108,6 @@ int Line = 1; -#ifdef _SQUID_MSWIN_ -#undef OPAQUE -#undef OPTIONAL -#endif - /* types of tokens */ #define CONTINUE -1 #define ENDOFFILE 0 @@ -129,7 +124,7 @@ #define COUNTER 9 #define GAUGE 10 #define TIMETICKS 11 -#define OPAQUE 12 +#define SNMP_OPAQUE 12 #define NUL 13 #define SEQUENCE 14 #define OF 15 /* SEQUENCE OF */ @@ -142,7 +137,7 @@ #define NOACCESS 21 #define STATUS 22 #define MANDATORY 23 -#define OPTIONAL 24 +#define SNMP_OPTIONAL 24 #define OBSOLETE 25 #define RECOMMENDED 26 #define PUNCT 27 @@ -170,9 +165,9 @@ struct tok tokens[] = { {"obsolete", sizeof("obsolete") - 1, OBSOLETE}, - {"Opaque", sizeof("Opaque") - 1, OPAQUE}, + {"Opaque", sizeof("Opaque") - 1, SNMP_OPAQUE}, {"recommended", sizeof("recommended") - 1, RECOMMENDED}, - {"optional", sizeof("optional") - 1, OPTIONAL}, + {"optional", sizeof("optional") - 1, SNMP_OPTIONAL}, {"mandatory", sizeof("mandatory") - 1, MANDATORY}, {"current", sizeof("current") - 1, MANDATORY}, {"not-accessible", sizeof("not-accessible") - 1, NOACCESS}, @@ -333,7 +328,7 @@ case TIMETICKS: translation_table[count] = TYPE_TIMETICKS; break; - case OPAQUE: + case SNMP_OPAQUE: translation_table[count] = TYPE_OPAQUE; break; case NUL: @@ -849,7 +844,7 @@ case COUNTER: case GAUGE: case TIMETICKS: - case OPAQUE: + case SNMP_OPAQUE: case NUL: case LABEL: strcpy(syntax, token); @@ -878,7 +873,7 @@ return 0; } type = get_token(fp, token); - if (type != MANDATORY && type != OPTIONAL && type != OBSOLETE && type != RECOMMENDED) { + if (type != MANDATORY && type != SNMP_OPTIONAL && type != OBSOLETE && type != RECOMMENDED) { print_error("Bad status", token, type); free_node(np); return 0; Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.18.6.1.2.7 retrieving revision 1.18.6.1.2.8 diff -u -r1.18.6.1.2.7 -r1.18.6.1.2.8 --- squid/src/comm.c 8 Apr 2002 17:06:10 -0000 1.18.6.1.2.7 +++ squid/src/comm.c 22 Sep 2002 11:38:05 -0000 1.18.6.1.2.8 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.18.6.1.2.7 2002/04/08 17:06:10 serassio Exp $ + * $Id: comm.c,v 1.18.6.1.2.8 2002/09/22 11:38:05 serassio Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -794,15 +794,15 @@ { #ifndef _SQUID_MSWIN_ int flags; -#endif int dummy = 0; +#endif #if defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) int nonblocking = TRUE; #ifdef _SQUID_CYGWIN_ if (fd_table[fd].type != FD_PIPE) { #endif if (ioctl(fd, FIONBIO, &nonblocking) < 0) { - debug(50, 0) ("commSetNonBlocking: FD %d: %s %D\n", fd, xstrerror(), fd_table[fd].type); + debug(50, 0) ("commSetNonBlocking: FD %d: %s %u\n", fd, xstrerror(), fd_table[fd].type); return COMM_ERROR; } #ifdef _SQUID_CYGWIN_ @@ -829,11 +829,11 @@ int commUnsetNonBlocking(int fd) { - int dummy = 0; #ifdef _SQUID_MSWIN_ int nonblocking = FALSE; if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) { #else + int dummy = 0; int flags; if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) { debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror()); Index: squid/src/debug.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/debug.c,v retrieving revision 1.9.10.5 retrieving revision 1.9.10.6 diff -u -r1.9.10.5 -r1.9.10.6 --- squid/src/debug.c 8 Apr 2002 17:06:10 -0000 1.9.10.5 +++ squid/src/debug.c 22 Sep 2002 11:38:05 -0000 1.9.10.6 @@ -1,6 +1,6 @@ /* - * $Id: debug.c,v 1.9.10.5 2002/04/08 17:06:10 serassio Exp $ + * $Id: debug.c,v 1.9.10.6 2002/09/22 11:38:05 serassio Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -283,7 +283,7 @@ /* * You can't rename open files on Microsoft "operating systems" * so we close before renaming. - */ + */ #ifdef _SQUID_MSWIN_ if (debug_log != stderr) fclose(debug_log); Index: squid/src/ipc.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ipc.c,v retrieving revision 1.7.10.6 retrieving revision 1.7.10.7 diff -u -r1.7.10.6 -r1.7.10.7 --- squid/src/ipc.c 21 Apr 2002 20:41:14 -0000 1.7.10.6 +++ squid/src/ipc.c 22 Sep 2002 11:38:05 -0000 1.7.10.7 @@ -1,6 +1,6 @@ /* - * $Id: ipc.c,v 1.7.10.6 2002/04/21 20:41:14 serassio Exp $ + * $Id: ipc.c,v 1.7.10.7 2002/09/22 11:38:05 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -48,7 +48,7 @@ char **args; }; -static struct thread_params +struct thread_params { int type; int rfd; @@ -56,6 +56,7 @@ const char *prog; pid_t pid; }; + static int __stdcall ipc_thread_1(struct ipc_params *params); static int __stdcall ipc_thread_2(struct thread_params *params); @@ -378,9 +379,9 @@ buf1 = xcalloc(1, 8192); strcpy(buf1, params->prog); prog = strtok(buf1, w_space); - if (str = strrchr(prog, '/')) + if ((str = strrchr(prog, '/'))) prog = ++str; - if (str = strrchr(prog, '\\')) + if ((str = strrchr(prog, '\\'))) prog = ++str; prog = xstrdup(prog); #else @@ -675,7 +676,8 @@ ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } else if (strncmp(buf1, ok_string, strlen(ok_string))) { - debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n"); + debug(54, 0) ("ipcCreate: CHILD: %s: socket exchange failed\n", + prog); debug(54, 0) ("--> read returned %d\n", x); buf1[x] = '\0'; debug(54, 0) ("--> got '%s'\n", rfc1738_escape(buf1)); @@ -771,7 +773,7 @@ getCurrentTime(); debug(54, 0) ("ipc(%s,%d): WARNING: ipc_thread_2 didn't exit in 3 seconds.\n", - prog, pid, prog); + prog, pid); } getCurrentTime(); if (!retval) Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.28.6.1.4.10 retrieving revision 1.28.6.1.4.11 diff -u -r1.28.6.1.4.10 -r1.28.6.1.4.11 --- squid/src/main.c 15 Jul 2002 06:18:08 -0000 1.28.6.1.4.10 +++ squid/src/main.c 22 Sep 2002 11:38:05 -0000 1.28.6.1.4.11 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.28.6.1.4.10 2002/07/15 06:18:08 serassio Exp $ + * $Id: main.c,v 1.28.6.1.4.11 2002/09/22 11:38:05 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -86,7 +86,9 @@ static void mainSetCwd(void); static int checkRunningPid(void); +#ifndef _SQUID_MSWIN_ static const char *squid_start_script = "squid_start"; +#endif #if TEST_ACCESS #include "test_access.c" @@ -920,7 +922,7 @@ WIN32_sendSignal(opt_send_signal); else { #endif -#ifdef _SQUID_MSWIN_ +#if defined(_SQUID_MSWIN_) && defined(USE_WIN32_SERVICE) fprintf(stderr, "%s: ERROR: Could not send ", appname); fprintf(stderr, "signal to Squid Service:\n"); fprintf(stderr, "missing -n command line switch.\n"); Index: squid/src/fs/awin32/aiops.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/awin32/Attic/aiops.c,v retrieving revision 1.1.62.8 retrieving revision 1.1.62.9 diff -u -r1.1.62.8 -r1.1.62.9 --- squid/src/fs/awin32/aiops.c 3 Aug 2002 18:50:45 -0000 1.1.62.8 +++ squid/src/fs/awin32/aiops.c 22 Sep 2002 11:38:06 -0000 1.1.62.9 @@ -1,5 +1,5 @@ /* - * $Id: aiops.c,v 1.1.62.8 2002/08/03 18:50:45 serassio Exp $ + * $Id: aiops.c,v 1.1.62.9 2002/09/22 11:38:06 serassio Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -338,11 +338,12 @@ { squidaio_thread_t *threadp; int i; - HANDLE hthreads[NUMTHREADS]; + HANDLE * hthreads; if (!squidaio_initialised) return; + hthreads = (HANDLE *) xcalloc (NUMTHREADS, sizeof (HANDLE)); threadp = threads; for (i = 0; i < NUMTHREADS; i++) { threadp->exit = 1; @@ -361,6 +362,7 @@ } CloseHandle(main_thread); squidaio_initialised = 0; + xfree(hthreads); } static DWORD WINAPI @@ -1033,7 +1035,7 @@ threadp = threads; for (i = 0; i < NUMTHREADS; i++) { - storeAppendPrintf(sentry, "%i\t0x%lx\t%d\n", i + 1, threadp->dwThreadId, threadp->requests); + storeAppendPrintf(sentry, "%i\t0x%lx\t%ld\n", i + 1, threadp->dwThreadId, threadp->requests); threadp = threadp->next; } } Index: squid/src/fs/ufs/store_dir_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_dir_ufs.c,v retrieving revision 1.21.6.1.4.10 retrieving revision 1.21.6.1.4.11 diff -u -r1.21.6.1.4.10 -r1.21.6.1.4.11 --- squid/src/fs/ufs/store_dir_ufs.c 22 Jul 2002 09:07:29 -0000 1.21.6.1.4.10 +++ squid/src/fs/ufs/store_dir_ufs.c 22 Sep 2002 11:38:06 -0000 1.21.6.1.4.11 @@ -860,7 +860,7 @@ char *new_path = xstrdup(storeUfsDirSwapLogFile(sd, ".new")); int fd; file_close(ufsinfo->swaplog_fd); -#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) +#if defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) if (unlink(swaplog_path) < 0) { debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); fatal("storeUfsDirCloseTmpSwapLog: unlink failed");