]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
CYGWIN port by Robert Collins
authorhno <>
Sat, 21 Oct 2000 05:50:58 +0000 (05:50 +0000)
committerhno <>
Sat, 21 Oct 2000 05:50:58 +0000 (05:50 +0000)
configure.in
lib/rfc1123.c
lib/util.c
src/Makefile.in
src/carp.cc
src/client_side.cc
src/comm.cc
src/disk.cc
src/main.cc
src/pinger.cc

index 139ad9349c0bb5c272996f1333d26b661a9ab359..04b1a0f78fdb0a322467bf656586cf50744ea20f 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.204 2000/10/04 00:20:58 wessels Exp $
+dnl  $Id: configure.in,v 1.205 2000/10/20 23:50:58 hno Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.204 $)dnl
+AC_REVISION($Revision: 1.205 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -29,7 +29,7 @@ fi
 
 dnl use .exe suffix for executables on cygwin32 platform
 case "$host_os" in
-cygwin32|os2)
+cygwin|cygwin32|os2)
        exec_suffix=".exe"
        cgi_suffix=".exe"
        ;;
@@ -929,11 +929,13 @@ AC_CACHE_CHECK(for ip->ip_hl, ac_cv_have_ip_hl, [
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
-#ifdef __linux__
+#if defined (__linux__) || defined (__CYGWIN__)
 #define ip_hl ihl
 #endif
 #ifndef __linux__
+#ifndef __CYGWIN__
 #define iphdr ip
+#endif
 #endif],
     [struct iphdr ip;
       ip.ip_hl= 0;],
@@ -1346,13 +1348,13 @@ main() {
        FILE *fp;
        int i,j;
 #if defined(__CYGWIN32__) || defined (__CYGWIN__)
-    /*
-     * getrlimit and sysconf returns bogous values on cygwin32.
+    /* getrlimit and sysconf returns bogous values on cygwin32.
      * Number of fds is virtually unlimited in cygwin (sys/param.h)
-     * NOTE: __CYGWIN32__ is deprecated.
+     * __CYGWIN32__ is deprecated.
      */
     i = NOFILE;
-#elif HAVE_SETRLIMIT
+#else
+#if HAVE_SETRLIMIT
     struct rlimit rl;
 #if defined(RLIMIT_NOFILE)
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
@@ -1387,6 +1389,7 @@ main() {
                 }
         }
         i++;
+#endif /* IF !DEF CYGWIN */
        fp = fopen("conftestval", "w");
        fprintf (fp, "%d\n", i);
        exit(0);
index a059573a5a6425468159321998ecdb06632abcba..f63eb6bbb15b0f3a32e2d2b51ad8e7b70f97dad1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: rfc1123.c,v 1.24 2000/03/27 21:56:21 wessels Exp $
+ * $Id: rfc1123.c,v 1.25 2000/10/20 23:50:59 hno Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -187,6 +187,7 @@ parse_rfc1123(const char *str)
 #if defined (_TIMEZONE)
 #elif defined (_timezone)
 #elif defined(_SQUID_AIX_)
+#elif defined(_SQUID_CYGWIN_)
 #else
        extern time_t timezone;
 #endif
@@ -196,7 +197,7 @@ parse_rfc1123(const char *str)
         */
        if (tm.tm_isdst > 0)
            dst = -3600;
-#ifdef _timezone
+#if defined ( _timezone) || defined(_SQUID_CYGWIN_)
        t -= (_timezone + dst);
 #else
        t -= (timezone + dst);
index fff246036358c711528829efb04c370e32f0b7ba..67fc4999ff895b100de01a08b153bc395371d50a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: util.c,v 1.72 2000/10/17 08:06:01 adrian Exp $
+ * $Id: util.c,v 1.73 2000/10/20 23:50:59 hno Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -78,9 +78,10 @@ static char msg[128];
 #if !defined(__CYGWIN__)
 extern int sys_nerr;
 #else
-extern __declspec(dllimport) int sys_nerr;
+  #define sys_nerr _sys_nerr
 #endif
 
+
 #if MEM_GEN_TRACE
 
 static FILE *tracefp = NULL;
index a184133703d89fd6cbd4d5393745d7135d177168..e227537531aefc62bf2c4d04aacfdc8bdc5742f9 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.194 2000/09/01 12:30:24 hno Exp $
+#  $Id: Makefile.in,v 1.195 2000/10/20 23:50:59 hno Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -391,7 +391,7 @@ install: all install-mkdirs
        fi
 
 install-pinger:
-       @f=pinger; \
+       @f=$(PINGER_EXE); \
        if test -f $(libexecdir)/$$f; then \
                echo $(MV) $(libexecdir)/$$f $(libexecdir)/-$$f; \
                $(MV) $(libexecdir)/$$f $(libexecdir)/-$$f; \
index 38c92a9dc1ddb6bde88a847f6b9ce98adbb648c6..1771229eefa6355c62bed378745cf3bf126c9f91 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: carp.cc,v 1.12 2000/08/01 22:31:16 wessels Exp $
+ * $Id: carp.cc,v 1.13 2000/10/20 23:50:59 hno Exp $
  *
  * DEBUG: section 39    Cache Array Routing Protocol
  * AUTHOR: Eric Stern
@@ -86,7 +86,7 @@ carpInit(void)
 peer *
 carpSelectParent(request_t * request)
 {
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> ((sizeof(u_long)*8)-(n))))
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (((sizeof(unsigned long)*8)-(n)))))
     const char *c;
     peer *p = NULL;
     peer *tp;
index 89908049e20f3fc39d746a10a018a1fc09b69564..807a8749fa35dc6801dbf46ff21cb8119c22ccf5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.507 2000/10/20 23:47:46 hno Exp $
+ * $Id: client_side.cc,v 1.508 2000/10/20 23:50:59 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1825,7 +1825,17 @@ clientKeepaliveNextRequest(clientHttpRequest * http)
         * Set the timeout BEFORE calling clientReadRequest().
         */
        commSetTimeout(conn->fd, Config.Timeout.pconn, requestTimeout, conn);
+        /*
+         * CYGWIN has a problem and is blocking on read() requests when there
+         * is no data present.
+         * This hack may hit performance a little, but it's better than 
+         * blocking!.
+         */
+#ifdef _SQUID_CYGWIN_
+        commSetSelect(conn->fd, COMM_SELECT_READ, clientReadRequest, conn, 0);
+#else
        clientReadRequest(conn->fd, conn);      /* Read next request */
+#endif
        /*
         * Note, the FD may be closed at this point.
         */
index 96d0b1e8002917d9a04986894779e04326f267d1..3ff2e3cc72cb9c2c42e43c6e72a69e4fa3ae8b1b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.310 2000/10/17 08:06:02 adrian Exp $
+ * $Id: comm.cc,v 1.311 2000/10/20 23:51:00 hno Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -720,6 +720,16 @@ commSetNonBlocking(int fd)
 {
     int flags;
     int dummy = 0;
+#ifdef _SQUID_CYGWIN_ 
+    int nonblocking = TRUE;
+    if(fd_table[fd].type != FD_PIPE) {
+        if(ioctl(fd, FIONBIO, &nonblocking) < 0) {
+            debug(50, 0) ("commSetNonBlocking: FD %d: %s %D\n", fd, xstrerror(), fd_table[fd].type);
+            return COMM_ERROR;
+        }
+    }
+    else {
+#endif 
     if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
        debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
        return COMM_ERROR;
@@ -728,6 +738,9 @@ commSetNonBlocking(int fd)
        debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, xstrerror());
        return COMM_ERROR;
     }
+#ifdef _SQUID_CYGWIN_ 
+   } 
+#endif 
     fd_table[fd].flags.nonblocking = 1;
     return 0;
 }
index 030f4a5063b5f31ddc210260b5b26e16e2218095..6724383bd7b2275d47d3aa483d66720bc05f60f5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: disk.cc,v 1.151 2000/10/17 08:06:03 adrian Exp $
+ * $Id: disk.cc,v 1.152 2000/10/20 23:51:00 hno Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -38,7 +38,7 @@
 static PF diskHandleRead;
 static PF diskHandleWrite;
 
-#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_)
 static int
 diskWriteIsComplete(int fd)
 {
@@ -92,7 +92,7 @@ file_close(int fd)
        read_callback(-1, F->read_data);
     }
     if (F->flags.write_daemon) {
-#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_)
        /*
         * on some operating systems, you can not delete or rename
         * open files, so we won't allow delayed close.
index be28e555ed9503541e874873586638f21552de64..ab0454c15cf7d2db403417d4c61bab91f217c7db 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.318 2000/10/17 08:06:03 adrian Exp $
+ * $Id: main.cc,v 1.319 2000/10/20 23:51:00 hno Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -846,6 +846,10 @@ watch_child(char *argv[])
        close(i);
     }
 #endif
+
+
+/* RBCOLLINS - if cygwin stackdumps when squid is run without -N, check the cygwin1.dll version, it needs to be AT LEAST 1.1.3. execvp had a bit overflow error in a loop.. 
+*/
     /* Connect stdio to /dev/null in daemon mode */
     nullfd = open("/dev/null", O_RDWR);
     dup2(nullfd, 0);
index 7c551d52ccc351d00e6bbf764f3368ef196bde40..b06b389fc2278672d2e478be4026d6c4bc6de67e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: pinger.cc,v 1.44 2000/05/16 07:06:06 wessels Exp $
+ * $Id: pinger.cc,v 1.45 2000/10/20 23:51:00 hno Exp $
  *
  * DEBUG: section 42    ICMP Pinger program
  * AUTHOR: Duane Wessels
 #include <netinet/ip_icmp.h>
 
 #ifndef _SQUID_LINUX_
+#ifndef _SQUID_CYGWIN_
 #define icmphdr icmp
 #define iphdr ip
 #endif
+#endif
 
-#ifdef _SQUID_LINUX_
+#if defined (_SQUID_LINUX_) || defined (_SQUID_CYGWIN_)
 #ifdef icmp_id
 #undef icmp_id
 #endif