--------------------- PatchSet 12100 Date: 2008/05/04 23:26:30 Author: hno Branch: SQUID_2_7 Tag: (none) Log: Author: serassio Windows port updates The Window support is no more "EXPERIMENTAL" since long time ... allow build of squid_radius_auth on Windows clean no more needed type casts into dns code add support for dirent-style functions: opendir(), readdir(), closedir(), rewinddir(), seekdir() and telldir on Windows. Members: CREDITS:1.11.6.1->1.11.6.2 helpers/basic_auth/squid_radius_auth/squid_rad_auth.c:1.2.6.3->1.2.6.4 helpers/basic_auth/squid_radius_auth/util.h:1.2->1.2.6.1 include/squid_mswin.h:1.5->1.5.2.1 lib/Makefile.am:1.10->1.10.2.1 lib/dirent.c:1.1->1.1.2.1 lib/getopt.c:1.2->1.2.2.1 lib/win32lib.c:1.4.2.1->1.4.2.2 src/dns_internal.c:1.63.2.4->1.63.2.5 Index: squid/CREDITS =================================================================== RCS file: /cvsroot/squid/squid/CREDITS,v retrieving revision 1.11.6.1 retrieving revision 1.11.6.2 diff -u -r1.11.6.1 -r1.11.6.2 --- squid/CREDITS 2 Jan 2008 15:49:25 -0000 1.11.6.1 +++ squid/CREDITS 4 May 2008 23:26:30 -0000 1.11.6.2 @@ -1,4 +1,4 @@ -$Id: CREDITS,v 1.11.6.1 2008/01/02 15:49:25 hno Exp $ +$Id: CREDITS,v 1.11.6.2 2008/05/04 23:26:30 hno Exp $ ============================================================================== @@ -302,6 +302,41 @@ ============================================================================== +lib/getopt.c: + +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; + +============================================================================== + src/external_acl.c Copyright (C) 2002 MARA Systems AB, Sweden Index: squid/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c,v retrieving revision 1.2.6.3 retrieving revision 1.2.6.4 diff -u -r1.2.6.3 -r1.2.6.4 --- squid/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c 17 Mar 2008 23:23:17 -0000 1.2.6.3 +++ squid/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c 4 May 2008 23:26:30 -0000 1.2.6.4 @@ -65,6 +65,9 @@ #if HAVE_FCNTL_H #include #endif +#ifdef _SQUID_WIN32_ +#include +#endif #if HAVE_CTYPE_H #include @@ -90,6 +93,12 @@ #if HAVE_STRING_H #include #endif +#if HAVE_GETOPT_H +#include +#endif +#if HAVE_ERRNO_H +#include +#endif #include "squid_md5.h" #include "radius.h" @@ -492,6 +501,12 @@ exit(1); } +#ifdef _SQUID_MSWIN_ + { + WSADATA wsaData; + WSAStartup(2, &wsaData); + } +#endif /* * Open a connection to the server. */ Index: squid/helpers/basic_auth/squid_radius_auth/util.h =================================================================== RCS file: /cvsroot/squid/squid/helpers/basic_auth/squid_radius_auth/util.h,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -r1.2 -r1.2.6.1 --- squid/helpers/basic_auth/squid_radius_auth/util.h 20 Nov 2007 14:11:21 -0000 1.2 +++ squid/helpers/basic_auth/squid_radius_auth/util.h 4 May 2008 23:26:30 -0000 1.2.6.1 @@ -1,2 +1,4 @@ +#include "../../../include/util.h" + /* util.c */ u_int32_t get_ipaddr (char *); Index: squid/include/squid_mswin.h =================================================================== RCS file: /cvsroot/squid/squid/include/squid_mswin.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- squid/include/squid_mswin.h 25 Apr 2007 07:55:32 -0000 1.5 +++ squid/include/squid_mswin.h 4 May 2008 23:26:32 -0000 1.5.2.1 @@ -1,5 +1,5 @@ /* - * $Id: squid_mswin.h,v 1.5 2007/04/25 07:55:32 serassio Exp $ + * $Id: squid_mswin.h,v 1.5.2.1 2008/05/04 23:26:32 hno Exp $ * * AUTHOR: Andrey Shorin * AUTHOR: Guido Serassio @@ -66,7 +66,6 @@ #include "default_config_file.h" /* Some tricks for MS Compilers */ #define __STDC__ 1 -#pragma include_alias(, ) #define THREADLOCAL __declspec(thread) #elif defined(__GNUC__) /* gcc environment */ @@ -244,12 +243,9 @@ #include #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ #pragma warning (pop) -#include "readdir.h" -#else +#endif #include #include -#include -#endif typedef char * caddr_t; Index: squid/lib/Makefile.am =================================================================== RCS file: /cvsroot/squid/squid/lib/Makefile.am,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -r1.10 -r1.10.2.1 --- squid/lib/Makefile.am 11 Nov 2007 01:35:11 -0000 1.10 +++ squid/lib/Makefile.am 4 May 2008 23:26:34 -0000 1.10.2.1 @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am,v 1.10 2007/11/11 01:35:11 amosjeffries Exp $ +# $Id: Makefile.am,v 1.10.2.1 2008/05/04 23:26:34 hno Exp $ # if NEED_OWN_SNPRINTF @@ -36,6 +36,8 @@ @LIBREGEX@ \ $(LIBSSPWIN32) EXTRA_libmiscutil_a_SOURCES = \ + dirent.c \ + getopt.c \ snprintf.c \ strsep.c \ win32lib.c Index: squid/lib/dirent.c =================================================================== RCS file: /cvsroot/squid/squid/lib/dirent.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- squid/lib/dirent.c 1 May 2008 18:50:29 -0000 1.1 +++ squid/lib/dirent.c 4 May 2008 23:26:34 -0000 1.1.2.1 @@ -1,5 +1,5 @@ /* - * $Id: dirent.c,v 1.1 2008/05/01 18:50:29 serassio Exp $ + * $Id: dirent.c,v 1.1.2.1 2008/05/04 23:26:34 hno Exp $ * * Implement dirent-style opendir(), readdir(), closedir(), rewinddir(), * seekdir() and telldir on Windows - Based on mingw-runtime package sources. Index: squid/lib/win32lib.c =================================================================== RCS file: /cvsroot/squid/squid/lib/win32lib.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- squid/lib/win32lib.c 25 Apr 2008 19:40:35 -0000 1.4.2.1 +++ squid/lib/win32lib.c 4 May 2008 23:26:34 -0000 1.4.2.2 @@ -1,6 +1,6 @@ /* - * $Id: win32lib.c,v 1.4.2.1 2008/04/25 19:40:35 hno Exp $ + * $Id: win32lib.c,v 1.4.2.2 2008/05/04 23:26:34 hno Exp $ * * Windows support * AUTHOR: Guido Serassio @@ -36,8 +36,7 @@ #include "util.h" -/* The following code section is part of an EXPERIMENTAL native */ -/* Windows NT/2000 Squid port - Compiles only on MS Visual C++ */ +/* The following code section is part of the native Windows Squid port */ #if defined(_SQUID_MSWIN_) #undef strerror @@ -791,4 +790,4 @@ else errno = EINVAL; } -#endif +#endif /* _SQUID_MSWIN_ */ Index: squid/src/dns_internal.c =================================================================== RCS file: /cvsroot/squid/squid/src/dns_internal.c,v retrieving revision 1.63.2.4 retrieving revision 1.63.2.5 diff -u -r1.63.2.4 -r1.63.2.5 --- squid/src/dns_internal.c 4 May 2008 23:23:13 -0000 1.63.2.4 +++ squid/src/dns_internal.c 4 May 2008 23:26:36 -0000 1.63.2.5 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.63.2.4 2008/05/04 23:23:13 hno Exp $ + * $Id: dns_internal.c,v 1.63.2.5 2008/05/04 23:26:36 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -340,10 +340,10 @@ &Size); if (Result == ERROR_SUCCESS && Size) { - t = (unsigned char *) xmalloc(Size); + t = (char *) xmalloc(Size); RegQueryValueEx(hndKey, "SearchList", NULL, &Type, (LPBYTE) t, &Size); - token = strtok((char *) t, Separator); + token = strtok(t, Separator); idnsFreeSearchpath(); while (token) { @@ -382,10 +382,10 @@ RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - t = (unsigned char *) xmalloc(Size); + t = (char *) xmalloc(Size); RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, t, &Size); - token = strtok((char *) t, ", "); + token = strtok(t, ", "); while (token) { idnsAddNameserver(token); debug(78, 1) ("Adding DHCP nameserver %s from Registry\n", @@ -397,9 +397,9 @@ Result = RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - t = (unsigned char *) xmalloc(Size); + t = (char *) xmalloc(Size); RegQueryValueEx(hndKey, "NameServer", NULL, &Type, t, &Size); - token = strtok((char *) t, ", "); + token = strtok(t, ", "); while (token) { debug(78, 1) ("Adding nameserver %s from Registry\n", token); @@ -440,10 +440,10 @@ RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - t = (unsigned char *) xmalloc(Size); + t = (char *) xmalloc(Size); RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, t, &Size); - token = strtok((char *) t, ", "); + token = strtok(t, ", "); while (token) { debug(78, 1) ("Adding DHCP nameserver %s from Registry\n", @@ -457,10 +457,10 @@ RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - t = (unsigned char *) xmalloc(Size); + t = (char *) xmalloc(Size); RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, t, &Size); - token = strtok((char *) t, ", "); + token = strtok(t, ", "); while (token) { debug(78, 1) ("Adding nameserver %s from Registry\n", token); @@ -490,9 +490,9 @@ Result = RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - t = (unsigned char *) xmalloc(Size); + t = (char *) xmalloc(Size); RegQueryValueEx(hndKey, "NameServer", NULL, &Type, t, &Size); - token = strtok((char *) t, ", "); + token = strtok(t, ", "); while (token) { debug(78, 1) ("Adding nameserver %s from Registry\n", token);