diff -NdruBbx configure ../squidclean/squid-2.3.STABLE3/README.cygwin ./README.cygwin --- ../squidclean/squid-2.3.STABLE3/README.cygwin Thu Jan 1 10:00:00 1970 +++ ./README.cygwin Thu Jun 15 22:54:32 2000 @@ -0,0 +1,24 @@ + + + Partial(buyer beware :-]) updated CYGWIN PORT of SQUID 2.3 Stable 3 + w/ stale reference patch. + + +KNOWN ISSUES: +* /etc/resolv.conf must have a valid nameserver. I haven't dug into squids dns_internal as yet. +* squid must be run -N, the fork call coredumps at the moment. +* configure doesn't test the SQUID_MAXFD values - but the workaround brings in a include with a reasonable number. I have seen an earlier port to native win32 of squid (Romeo Anghelache - http://www.phys-iasi.ro/users/romeo/) that recommended this be set around 2000. The include sets it to 8192, but as I am only running small sites at the moment so this hasn't been load tested into the high numbers. +* dnsserver.c has some problems at the moment, but the internal dns server runs fine. To get dnsserver to compile, run make and after make has stap an error, run the same command, but don't link agains m - ie remove -lm from the gcc command. +* rfc1123.c has an issue with _timezone deing defined twice. I edited /usr/include/time.h and define this under the ANSI #ifdef where timezone is exported from.This probably should be included in the squid patch rather than the platform... +* the #define for the sys_nerr import in util.c should probably go via ./configure, and may not be the best way to do it. + +Installation notes: +* Install the bind 8.1.2 or newer rpm (I got it from Rebums' at http://cygwin.cjb.net/. +* Run configure and edit include/autoconf.h as listed above +* Use srvany (NT resource kit) or a similar tool to run squid as a service +* For some reason, util.c got \r's when patch'd. You may need to put it through dos2unix or a similar filter, or compile off a text-mode mount. +* edit your time.h as described above. + +Rob Collins, Jul 2000 +rbtcollins@hotmail.com + diff -NdruBbx configure ../squidclean/squid-2.3.STABLE3/configure.in ./configure.in --- ../squidclean/squid-2.3.STABLE3/configure.in Sat Apr 29 06:17:12 2000 +++ ./configure.in Thu Jun 15 22:47:53 2000 @@ -1153,12 +1153,14 @@ main() { FILE *fp; int i,j; -#if __CYGWIN32__ +#if defined(__CYGWIN32__) || defined (__CYGWIN__) /* getrlimit and sysconf returns bogous values on cygwin32. * Number of fds is virtually unlimited in cygwin (sys/param.h) + * __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) { @@ -1193,6 +1195,7 @@ } } i++; +#endif /* IF !DEF CYGWIN */ fp = fopen("conftestval", "w"); fprintf (fp, "%d\n", i); exit(0); diff -NdruBbx configure ../squidclean/squid-2.3.STABLE3/include/config.h.in ./include/config.h.in --- ../squidclean/squid-2.3.STABLE3/include/config.h.in Sun Sep 12 11:35:06 1999 +++ ./include/config.h.in Tue Jun 13 22:32:27 2000 @@ -97,7 +97,7 @@ #elif defined(__NetBSD__) #define _SQUID_NETBSD_ -#elif defined(__CYGWIN32__) || defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32) +#elif defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32) #define _SQUID_MSWIN_ #elif defined(__APPLE__) diff -NdruBbx configure ../squidclean/squid-2.3.STABLE3/lib/util.c ./lib/util.c --- ../squidclean/squid-2.3.STABLE3/lib/util.c Thu Feb 10 10:29:51 2000 +++ ./lib/util.c Thu Jun 15 09:29:14 2000 @@ -73,7 +73,13 @@ void (*failure_notify) (const char *) = NULL; static char msg[128]; + +#if !defined(__CYGWIN__) extern int sys_nerr; +#else + #define sys_nerr _sys_nerr +#endif + #if MEM_GEN_TRACE diff -NdruBbx configure ../squidclean/squid-2.3.STABLE3/src/comm.c ./src/comm.c --- ../squidclean/squid-2.3.STABLE3/src/comm.c Thu Feb 10 10:29:54 2000 +++ ./src/comm.c Thu Jun 15 21:39:54 2000 @@ -708,6 +708,16 @@ { int flags; int dummy = 0; +#ifdef _SQUID_MSWIN_ + int nonblocking = TRUE; + if(fd_table[fd].type != 4) { + 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; @@ -716,6 +726,9 @@ debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, xstrerror()); return COMM_ERROR; } +#ifdef _SQUID_MSWIN_ + } +#endif fd_table[fd].flags.nonblocking = 1; return 0; } diff -NdruBbx configure ../squidclean/squid-2.3.STABLE3/src/dns_internal.c ./src/dns_internal.c --- ../squidclean/squid-2.3.STABLE3/src/dns_internal.c Wed Mar 22 16:01:42 2000 +++ ./src/dns_internal.c Tue Jun 13 18:46:15 2000 @@ -301,7 +301,7 @@ ssize_t len; struct sockaddr_in from; socklen_t from_len; - int max = 10; + int max = INCOMING_DNS_MAX; static char rbuf[512]; int ns; while (max--) {