Squid-1.2beta18: Nt port running [patch]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 06 Apr 1998 00:32:46 +0200

This is a multi-part message in MIME format.

--------------75C633D85E2B12E21F6EFB9A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The NT port is running!

Squid-1.2.beta18: Compile on Win-NT using cygwin b19
      Corrections and platform specific changes for compiling on
      Windows-NT using Cygnus GNU-Win32 b19.
         1.Rename aux to auxconf
         2.Rename src/Mem.c to src/MemPool.c
         3.Apply the patch
         4.Build

      If you don't have uudecude, use WinZIP to unpack icons/icons.shar.

      /bin/sh needs to be found. Run
          mount 'c:\Cygnus\b19\H-i386-cygwin32\bin' /bin
      to tell cygwin where /bin/... is.

/Henrik

--------------75C633D85E2B12E21F6EFB9A
Content-Type: text/plain; charset=us-ascii; name="squid-1.2.beta18.cygwin32.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="squid-1.2.beta18.cygwin32.patch"

Index: squid/configure
diff -u squid/configure:1.1.1.9 squid/configure:1.1.1.9.2.5
--- squid/configure:1.1.1.9 Tue Mar 24 19:59:55 1998
+++ squid/configure Mon Apr 6 00:07:50 1998
@@ -557,9 +557,9 @@
 
 
 
 # From configure.in Revision: 1.107
 ac_aux_dir=
-for ac_dir in aux $srcdir/aux; do
+for ac_dir in auxconf $srcdir/auxconf; do
   if test -f $ac_dir/install-sh; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -571,7 +571,7 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in aux $srcdir/aux" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in auxconf $srcdir/auxconf" 1>&2; exit 1; }
 fi
 ac_config_guess=$ac_aux_dir/config.guess
 ac_config_sub=$ac_aux_dir/config.sub
@@ -616,6 +616,19 @@
 
 fi
 
+case "$host_os" in
+cygwin32)
+ exec_suffix=".exe"
+ cgi_suffix=".exe"
+ ;;
+*)
+ exec_suffix=""
+ cgi_suffix=".cgi"
+ ;;
+esac
+
+
+
 if test -z "$CACHE_HTTP_PORT"; then
         CACHE_HTTP_PORT="3128"
 fi
@@ -3408,6 +3421,7 @@
 
 for ac_func in \
         bcopy \
+ crypt \
         fchmod \
         getdtablesize \
         getpagesize \
@@ -3604,8 +3618,8 @@
 fi
 
 echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6
 echo "configure:3608: checking if GNUregex needs to be compiled" >&5
-if test "$ac_cv_func_regcomp" = "no" ; then
+if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
         USE_GNUREGEX="yes"
 else
         USE_GNUREGEX="no"
@@ -3755,6 +3769,12 @@
 #include <sys/resource.h>
 main() {
         int i,j;
+#if __CYGWIN32__
+ /* getrlimit and sysconf returns bogous values on cygwin32.
+ * Number of fds is virtually unlimited in cygwin (sys/param.h)
+ */
+ i = NOFILE;
+#else
 #if HAVE_SETRLIMIT
     struct rlimit rl;
 #if defined(RLIMIT_NOFILE)
@@ -3792,12 +3812,13 @@
         close(i); close(i-1);
         i++;
 #endif
+#endif /* __CYGWIN32__ */
         fprintf (fopen("conftestval", "w"), "%d\n", i);
         exit(0);
 }
 
 EOF
 if { (eval echo configure:3801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_MAXFD=`cat conftestval`
 else
@@ -4214,6 +4235,8 @@
 s%@host_cpu@%$host_cpu%g
 s%@host_vendor@%$host_vendor%g
 s%@host_os@%$host_os%g
+s%@exec_suffix@%$exec_suffix%g
+s%@cgi_suffix@%$cgi_suffix%g
 s%@CACHE_HTTP_PORT@%$CACHE_HTTP_PORT%g
 s%@CACHE_ICP_PORT@%$CACHE_ICP_PORT%g
 s%@CC@%$CC%g
Index: squid/configure.in
diff -u squid/configure.in:1.1.1.11 squid/configure.in:1.1.1.11.2.6
--- squid/configure.in:1.1.1.11 Tue Mar 24 19:59:55 1998
+++ squid/configure.in Sun Apr 5 23:45:52 1998
@@ -11,7 +11,7 @@
 AC_CONFIG_HEADER(include/autoconf.h)
 AC_REVISION($Revision$)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
-AC_CONFIG_AUX_DIR(aux)
+AC_CONFIG_AUX_DIR(auxconf)
 
 AC_CANONICAL_HOST
 
@@ -26,6 +26,20 @@
 
 fi
 
+dnl use .exe suffix for executables on cygwin32 platform
+case "$host_os" in
+cygwin32)
+ exec_suffix=".exe"
+ cgi_suffix=".exe"
+ ;;
+*)
+ exec_suffix=""
+ cgi_suffix=".cgi"
+ ;;
+esac
+AC_SUBST(exec_suffix)
+AC_SUBST(cgi_suffix)
+
 if test -z "$CACHE_HTTP_PORT"; then
         CACHE_HTTP_PORT="3128"
 fi
@@ -596,6 +610,7 @@
 dnl Check for library functions
 AC_CHECK_FUNCS(\
         bcopy \
+ crypt \
         fchmod \
         getdtablesize \
         getpagesize \
@@ -666,7 +681,7 @@
 fi
 
 AC_MSG_CHECKING(if GNUregex needs to be compiled)
-if test "$ac_cv_func_regcomp" = "no" ; then
+if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
         USE_GNUREGEX="yes"
 else
         USE_GNUREGEX="no"
@@ -732,6 +747,12 @@
 #include <sys/resource.h>
 main() {
         int i,j;
+#if __CYGWIN32__
+ /* getrlimit and sysconf returns bogous values on cygwin32.
+ * Number of fds is virtually unlimited in cygwin (sys/param.h)
+ */
+ i = NOFILE;
+#else
 #if HAVE_SETRLIMIT
     struct rlimit rl;
 #if defined(RLIMIT_NOFILE)
@@ -769,6 +790,7 @@
         close(i); close(i-1);
         i++;
 #endif
+#endif /* __CYGWIN32__ */
         fprintf (fopen("conftestval", "w"), "%d\n", i);
         exit(0);
 }
Index: squid/src/HttpHeaderTools.c
diff -u squid/src/HttpHeaderTools.c:1.1.1.2 squid/src/HttpHeaderTools.c:1.1.1.2.2.1
--- squid/src/HttpHeaderTools.c:1.1.1.2 Tue Mar 24 20:00:10 1998
+++ squid/src/HttpHeaderTools.c Sun Apr 5 23:37:47 1998
@@ -198,8 +198,13 @@
     /* disabled for now */
     /* return; */
     /* do not print too much, kludge */
+#if HAVE_LRAND48
     if (bug_count > 25 && (lrand48() % bug_count) > 3L)
         return;
+#else
+ if (bug_count > 25 && (rand() % bug_count) > 3L)
+ return;
+#endif /* HAVE_LRAND48 */
     /* skip start line if any */
     if (!strncasecmp(hstr, "HTTP/", 5)) {
         const char *p = strchr(hstr, '\n');
Index: squid/src/Makefile.in
diff -u squid/src/Makefile.in:1.1.1.13 squid/src/Makefile.in:1.1.1.13.2.2
--- squid/src/Makefile.in:1.1.1.13 Tue Mar 24 20:00:10 1998
+++ squid/src/Makefile.in Sun Apr 5 23:37:48 1998
@@ -8,6 +8,8 @@
 
 prefix = @prefix@
 exec_prefix = @exec_prefix@
+exec_suffix = @exec_suffix@
+cgi_suffix = @cgi_suffix@
 top_srcdir = @top_srcdir@
 bindir = @bindir@
 libexecdir = @libexecdir@
@@ -61,10 +63,10 @@
 DNSSERVER_LIBS = -L../lib -lmiscutil $(XTRA_LIBS)
 PINGER_LIBS = -L../lib -lmiscutil $(XTRA_LIBS)
 
-PROGS = squid client
-UTILS = dnsserver unlinkd
-SUID_UTILS = pinger
-CGIPROGS = cachemgr.cgi
+PROGS = squid$(exec_suffix) client$(exec_suffix)
+UTILS = dnsserver$(exec_suffix) unlinkd$(exec_suffix)
+SUID_UTILS = pinger$(exec_suffix)
+CGIPROGS = cachemgr$(cgi_suffix)
 OBJS = \
                 access_log.o \
                 acl.o \
@@ -105,7 +107,7 @@
                 ipcache.o \
                 main.o \
                 mem.o \
- Mem.o \
+ MemPool.o \
                 MemBuf.o \
                 mime.o \
                 multicast.o \
@@ -163,7 +165,7 @@
 
 $(OBJS): $(top_srcdir)/include/version.h
 
-squid: $(OBJS)
+squid$(exec_suffix): $(OBJS)
         $(CC) -o $@ $(LDFLAGS) $(OBJS) $(SQUID_LIBS)
 
 globals.o: globals.c Makefile
@@ -175,19 +177,19 @@
 string_arrays.c: enums.h mk-string-arrays.pl
         $(PERL) $(srcdir)/mk-string-arrays.pl < $(srcdir)/enums.h > $@
 
-client: client.o
- $(CC) -o $@ $(LDFLAGS) $@.o $(CLIENT_LIBS)
+client$(exec_suffix): client.o
+ $(CC) -o $@ $(LDFLAGS) client.o $(CLIENT_LIBS)
 
-dnsserver: dnsserver.o
- $(CC) -o $@ $(LDFLAGS) $@.o $(DNSSERVER_LIBS)
+dnsserver$(exec_suffix): dnsserver.o
+ $(CC) -o $@ $(LDFLAGS) dnsserver.o $(DNSSERVER_LIBS)
 
-cachemgr.cgi: cachemgr.o
+cachemgr$(cgi_suffix): cachemgr.o
         $(CC) -o $@ $(LDFLAGS) cachemgr.o $(CLIENT_LIBS)
 
-pinger: pinger.o
+pinger$(exec_suffix): pinger.o
         $(CC) -o $@ $(LDFLAGS) pinger.o debug.o globals.o $(PINGER_LIBS)
 
-unlinkd: unlinkd-daemon.o
+unlinkd$(exec_suffix): unlinkd-daemon.o
         $(CC) $(LDFLAGS) unlinkd-daemon.o -o $@
 
 unlinkd-daemon.o: unlinkd.c
Index: squid/src/acl.c
diff -u squid/src/acl.c:1.1.1.14 squid/src/acl.c:1.1.1.14.2.1
--- squid/src/acl.c:1.1.1.14 Tue Mar 24 20:00:11 1998
+++ squid/src/acl.c Sun Apr 5 23:37:48 1998
@@ -1214,7 +1214,11 @@
         return 1;
     }
     *passwd &= (~0x80);
+#if HAVE_CRYPT
     if (strcmp(hashr->item, (char *) crypt(passwd, hashr->item))) {
+#else
+ if (strcmp(hashr->item, passwd)) {
+#endif
         /* Passwords differ, deny access */
         p->last_time = 0; /* Trigger a check of the password file */
         debug(28, 4) ("aclMatchProxyAuth: authentication failed: user %s: "
Index: squid/src/dnsserver.c
diff -u squid/src/dnsserver.c:1.1.1.7 squid/src/dnsserver.c:1.1.1.7.4.1
--- squid/src/dnsserver.c:1.1.1.7 Sun Mar 8 15:46:43 1998
+++ squid/src/dnsserver.c Sun Apr 5 23:37:48 1998
@@ -304,12 +304,16 @@
             exit(1);
             break;
         case 's':
+#if HAVE_RES_INIT
             if (opt_s == 0) {
                 _res.nscount = 0;
                 _res.options |= RES_INIT;
                 opt_s = 1;
             }
             safe_inet_addr(optarg, &_res.nsaddr_list[_res.nscount++].sin_addr);
+#else
+ fprintf(stderr, "-s is not supported on this resolver\n");
+#endif /* HAVE_RES_INIT */
             break;
         case 'v':
             printf("dnsserver version %s\n", SQUID_VERSION);
Index: squid/src/store_dir.c
diff -u squid/src/store_dir.c:1.1.1.10 squid/src/store_dir.c:1.1.1.10.6.1
--- squid/src/store_dir.c:1.1.1.10 Sat Feb 14 01:00:33 1998
+++ squid/src/store_dir.c Sun Apr 5 21:12:49 1998
@@ -457,11 +457,11 @@
     char *new_path = xstrdup(storeDirSwapLogFile(dirn, ".new"));
     SwapDir *SD = &Config.cacheSwap.swapDirs[dirn];
     int fd;
+ file_close(SD->swaplog_fd);
     if (rename(new_path, swaplog_path) < 0) {
         debug(50, 0) ("%s,%s: %s\n", new_path, swaplog_path, xstrerror());
         fatal("storeDirCloseTmpSwapLog: rename failed");
     }
- file_close(SD->swaplog_fd);
     fd = file_open(swaplog_path, O_WRONLY | O_CREAT, NULL, NULL, NULL);
     if (fd < 0) {
         debug(50, 1) ("%s: %s\n", swaplog_path, xstrerror());
Index: squid/src/store_rebuild.c
diff -u squid/src/store_rebuild.c:1.1.1.4 squid/src/store_rebuild.c:1.1.1.4.4.1
--- squid/src/store_rebuild.c:1.1.1.4 Sun Mar 8 15:46:54 1998
+++ squid/src/store_rebuild.c Sun Apr 5 21:12:49 1998
@@ -714,6 +714,8 @@
          */
         fp = storeDirOpenTmpSwapLog(i, &clean, &zero);
         if (fp == NULL || zero) {
+ if (fp != NULL)
+ fclose(fp);
             d->rebuild_func = storeRebuildFromDirectory;
         } else {
             d->rebuild_func = storeRebuildFromSwapLog;

--------------75C633D85E2B12E21F6EFB9A--
Received on Tue Jul 29 2003 - 13:15:47 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:45 MST