diff -urN squid-2.2.STABLE5/auth_modules/SMB/Makefile squid-2.2.STABLE5.DJL1/auth_modules/SMB/Makefile --- squid-2.2.STABLE5/auth_modules/SMB/Makefile Sat Dec 12 03:59:55 1998 +++ squid-2.2.STABLE5.DJL1/auth_modules/SMB/Makefile Thu Oct 21 23:14:19 1999 @@ -30,3 +30,5 @@ clean: rm -f smb_auth $(OBJECTS) + +distclean: clean diff -urN squid-2.2.STABLE5/configure.in squid-2.2.STABLE5.DJL1/configure.in --- squid-2.2.STABLE5/configure.in Thu Sep 23 08:06:45 1999 +++ squid-2.2.STABLE5.DJL1/configure.in Thu Oct 21 23:14:19 1999 @@ -919,7 +919,6 @@ AC_CHECK_FUNCS(\ bcopy \ crypt \ - drand48 \ fchmod \ getdtablesize \ getpagesize \ @@ -953,7 +952,6 @@ srandom \ sysconf \ syslog \ - tempnam \ timegm \ vsnprintf \ ) diff -urN squid-2.2.STABLE5/lib/Makefile.in squid-2.2.STABLE5.DJL1/lib/Makefile.in --- squid-2.2.STABLE5/lib/Makefile.in Tue Aug 18 07:01:24 1998 +++ squid-2.2.STABLE5.DJL1/lib/Makefile.in Thu Oct 21 23:14:19 1999 @@ -68,7 +68,7 @@ distclean: clean -rm -f libregex.a - -rm -f Makefile + -rm -f Makefile Makefile.bak install: all diff -urN squid-2.2.STABLE5/makefile.in squid-2.2.STABLE5.DJL1/makefile.in --- squid-2.2.STABLE5/makefile.in Sat Jan 30 07:47:41 1999 +++ squid-2.2.STABLE5.DJL1/makefile.in Thu Oct 21 23:14:19 1999 @@ -15,6 +15,8 @@ exec_prefix = @exec_prefix@ SUBDIRS = lib @makesnmplib@ scripts src icons errors +AUTHDIRS = auth_modules/NCSA auth_modules/getpwnam \ + auth_modules/SMB noargs: all @@ -37,8 +39,8 @@ almostclean: clean rm -f config.log makefile rm -f include/paths.h include/autoconf.h include/config.h - rm -f auth_modules/NCSA/Makefile auth_modules/dummy - @for dir in $(SUBDIRS) contrib; do \ + rm -f auth_modules/dummy + @for dir in $(SUBDIRS) $(AUTHDIRS) contrib; do \ echo Making distclean in $$dir; \ (cd $$dir; $(MAKE) $(MFLAGS) prefix="$(prefix)" distclean); \ done diff -urN squid-2.2.STABLE5/src/Makefile.in squid-2.2.STABLE5.DJL1/src/Makefile.in --- squid-2.2.STABLE5/src/Makefile.in Sat Jan 23 03:07:01 1999 +++ squid-2.2.STABLE5.DJL1/src/Makefile.in Thu Oct 21 23:14:19 1999 @@ -360,7 +360,7 @@ -rm -f cf_gen cf_parser.c cf.data globals.c string_arrays.c distclean: clean - -rm -f Makefile squid.conf squid.conf.pre + -rm -f Makefile Makefile.bak squid.conf squid.conf.pre tags: ctags *.[ch] ../include/*.h ../lib/*.[ch] diff -urN squid-2.2.STABLE5/src/authenticate.c squid-2.2.STABLE5.DJL1/src/authenticate.c --- squid-2.2.STABLE5/src/authenticate.c Sat Dec 5 08:54:15 1998 +++ squid-2.2.STABLE5.DJL1/src/authenticate.c Thu Oct 21 23:14:19 1999 @@ -120,8 +120,8 @@ cachemgrRegister("authenticator", "User Authenticator Stats", authenticateStats, 0, 1); + init++; } - init++; } void diff -urN squid-2.2.STABLE5/src/comm_select.c squid-2.2.STABLE5.DJL1/src/comm_select.c --- squid-2.2.STABLE5/src/comm_select.c Tue Jan 19 06:23:33 1999 +++ squid-2.2.STABLE5.DJL1/src/comm_select.c Thu Oct 21 23:23:36 1999 @@ -158,6 +158,31 @@ return 0; } +#if DELAY_POOLS +static int slowfdcnt = 0; +static int slowfdarr[SQUID_MAXFD]; + +static void +commAddSlowFd(int fd) +{ + assert(slowfdcnt < SQUID_MAXFD); + slowfdarr[slowfdcnt++] = fd; +} + +static int +commGetSlowFd(void) +{ + int whichfd, retfd; + + if(!slowfdcnt) + return -1; + whichfd = squid_random() % slowfdcnt; + retfd = slowfdarr[whichfd]; + slowfdarr[whichfd] = slowfdarr[--slowfdcnt]; + return retfd; +} +#endif + #if HAVE_POLL static int comm_check_incoming_poll_handlers(int nfds, int *fds) @@ -270,6 +295,9 @@ comm_poll(int msec) { struct pollfd pfds[SQUID_MAXFD]; +#if DELAY_POOLS + fd_set slowfds; +#endif PF *hdl = NULL; int fd; int i; @@ -288,6 +316,9 @@ #if USE_ASYNC_IO aioCheckCallbacks(); #endif +#if DELAY_POOLS + FD_ZERO(&slowfds); +#endif if (commCheckICPIncoming) comm_poll_icp_incoming(); if (commCheckHTTPIncoming) @@ -299,8 +330,26 @@ int events; events = 0; /* Check each open socket for a handler. */ +#if DELAY_POOLS + if (fd_table[i].read_handler) { + switch (commDeferRead(i)) { + case 0: + events |= POLLRDNORM; + break; + case 1: + break; + case -1: + events |= POLLRDNORM; + FD_SET(i, &slowfds); + break; + default: + assert(!"commDeferRead(i) should return 0,1,-1"); + } + } +#else if (fd_table[i].read_handler && !commDeferRead(i)) events |= POLLRDNORM; +#endif if (fd_table[i].write_handler) events |= POLLWRNORM; if (events) { @@ -357,15 +406,23 @@ F = &fd_table[fd]; if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) { debug(5, 6) ("comm_poll: FD %d ready for reading\n", fd); - if ((hdl = F->read_handler)) { + if ((hdl = F->read_handler) +#if DELAY_POOLS + && !FD_ISSET(fd, &slowfds) +#endif + ) { F->read_handler = NULL; hdl(fd, F->read_data); Counter.select_fds++; + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); } - if (commCheckICPIncoming) - comm_poll_icp_incoming(); - if (commCheckHTTPIncoming) - comm_poll_http_incoming(); +#if DELAY_POOLS + else if(hdl) + commAddSlowFd(fd); +#endif } if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { debug(5, 5) ("comm_poll: FD %d ready for writing\n", fd); @@ -373,11 +430,11 @@ F->write_handler = NULL; hdl(fd, F->write_data); Counter.select_fds++; + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); } - if (commCheckICPIncoming) - comm_poll_icp_incoming(); - if (commCheckHTTPIncoming) - comm_poll_http_incoming(); } if (revents & POLLNVAL) { close_handler *ch; @@ -408,6 +465,21 @@ comm_poll_icp_incoming(); if (callhttp) comm_poll_http_incoming(); +#if DELAY_POOLS + while((fd = commGetSlowFd()) != -1) { + fde *F = &fd_table[fd]; + debug(5, 6) ("comm_select: slow FD %d selected for reading\n", fd); + if((hdl = F->read_handler)) { + F->read_handler = NULL; + hdl(fd, F->read_data); + Counter.select_fds++; + if (commCheckICPIncoming) + comm_poll_icp_incoming(); + if (commCheckHTTPIncoming) + comm_poll_http_incoming(); + } + } +#endif #if !ALARM_UPDATES_TIME getCurrentTime(); Counter.select_time += (current_dtime - start); @@ -535,6 +607,9 @@ { fd_set readfds; fd_set writefds; +#if DELAY_POOLS + fd_set slowfds; +#endif PF *hdl = NULL; int fd; int maxfd; @@ -569,6 +644,9 @@ howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES); xmemcpy(&writefds, &global_writefds, howmany(maxfd, FD_MASK_BITS) * FD_MASK_BYTES); +#if DELAY_POOLS + FD_ZERO(&slowfds); +#endif /* remove stalled FDs */ maxindex = howmany(maxfd, FD_MASK_BITS); fdsp = (fd_mask *) & readfds; @@ -580,14 +658,33 @@ continue; /* Found a set bit */ fd = (j * FD_MASK_BITS) + k; +#if DELAY_POOLS + switch (commDeferRead(fd)) { + case 0: + break; + case 1: + FD_CLR(fd, &readfds); + break; + case -1: + FD_SET(fd, &slowfds); + break; + default: + assert(!"commDeferRead(fd) should return 0,1,-1"); + } +#else if (commDeferRead(fd)) FD_CLR(fd, &readfds); +#endif } } #if DEBUG_FDBITS for (i = 0; i < maxfd; i++) { /* Check each open socket for a handler. */ +#if DELAY_POOLS + if (fd_table[i].read_handler && commDeferRead(i) != 1) { +#else if (fd_table[i].read_handler && !commDeferRead(i)) { +#endif assert(FD_ISSET(i, &readfds)); } if (fd_table[i].write_handler) { @@ -641,8 +738,11 @@ if ((tmask = fdsp[j]) == 0) continue; /* no bits here */ for (k = 0; k < FD_MASK_BITS; k++) { + if (tmask == 0) + break; /* and no more bits left */ if (!EBIT_TEST(tmask, k)) continue; + EBIT_CLR(tmask, k); /* this bit is done */ /* Found a set bit */ fd = (j * FD_MASK_BITS) + k; #if DEBUG_FDBITS @@ -659,20 +759,24 @@ } F = &fd_table[fd]; debug(5, 6) ("comm_select: FD %d ready for reading\n", fd); - if (F->read_handler) { - hdl = F->read_handler; + if ((hdl = F->read_handler) +#if DELAY_POOLS + && !FD_ISSET(fd, &slowfds) +#endif + ) { F->read_handler = NULL; commUpdateReadBits(fd, NULL); hdl(fd, F->read_data); Counter.select_fds++; + if (commCheckICPIncoming) + comm_select_icp_incoming(); + if (commCheckHTTPIncoming) + comm_select_http_incoming(); } - if (commCheckICPIncoming) - comm_select_icp_incoming(); - if (commCheckHTTPIncoming) - comm_select_http_incoming(); - EBIT_CLR(tmask, k); /* this bit is done */ - if (tmask == 0) - break; /* and no more bits left */ +#if DELAY_POOLS + else if(hdl) + commAddSlowFd(fd); +#endif } } fdsp = (fd_mask *) & writefds; @@ -680,8 +784,11 @@ if ((tmask = fdsp[j]) == 0) continue; /* no bits here */ for (k = 0; k < FD_MASK_BITS; k++) { + if (tmask == 0) + break; /* and no more bits left */ if (!EBIT_TEST(tmask, k)) continue; + EBIT_CLR(tmask, k); /* this bit is done */ /* Found a set bit */ fd = (j * FD_MASK_BITS) + k; #if DEBUG_FDBITS @@ -698,26 +805,38 @@ } F = &fd_table[fd]; debug(5, 5) ("comm_select: FD %d ready for writing\n", fd); - if (F->write_handler) { - hdl = F->write_handler; + if ((hdl = F->write_handler)) { F->write_handler = NULL; commUpdateWriteBits(fd, NULL); hdl(fd, F->write_data); Counter.select_fds++; + if (commCheckICPIncoming) + comm_select_icp_incoming(); + if (commCheckHTTPIncoming) + comm_select_http_incoming(); } - if (commCheckICPIncoming) - comm_select_icp_incoming(); - if (commCheckHTTPIncoming) - comm_select_http_incoming(); - EBIT_CLR(tmask, k); /* this bit is done */ - if (tmask == 0) - break; /* and no more bits left */ } } if (callicp) comm_select_icp_incoming(); if (callhttp) comm_select_http_incoming(); +#if DELAY_POOLS + while((fd = commGetSlowFd()) != -1) { + F = &fd_table[fd]; + debug(5, 6) ("comm_select: slow FD %d selected for reading\n", fd); + if ((hdl = F->read_handler)) { + F->read_handler = NULL; + commUpdateReadBits(fd, NULL); + hdl(fd, F->read_data); + Counter.select_fds++; + if (commCheckICPIncoming) + comm_select_icp_incoming(); + if (commCheckHTTPIncoming) + comm_select_http_incoming(); + } + } +#endif return COMM_OK; } while (timeout > current_dtime); debug(5, 8) ("comm_select: time out: %d\n", (int) squid_curtime); diff -urN squid-2.2.STABLE5/src/dns.c squid-2.2.STABLE5.DJL1/src/dns.c --- squid-2.2.STABLE5/src/dns.c Mon Jan 18 03:46:28 1999 +++ squid-2.2.STABLE5.DJL1/src/dns.c Thu Oct 21 23:14:19 1999 @@ -68,8 +68,8 @@ cachemgrRegister("dns", "Dnsserver Statistics", dnsStats, 0, 1); + init++; } - init++; } void diff -urN squid-2.2.STABLE5/src/forward.c squid-2.2.STABLE5.DJL1/src/forward.c --- squid-2.2.STABLE5/src/forward.c Wed Jul 7 09:52:50 1999 +++ squid-2.2.STABLE5.DJL1/src/forward.c Thu Oct 21 23:14:19 1999 @@ -458,6 +458,12 @@ { StoreEntry *e = data; MemObject *mem = e->mem_obj; +#ifdef DELAY_POOLS + int i = 0; +#else +#define i 0 +#endif + if (mem == NULL) return 0; #if DELAY_POOLS @@ -465,14 +471,21 @@ (void) 0; else if (delayIsNoDelay(fd)) (void) 0; - else if (delayMostBytesWanted(mem, 1) == 0) - return 1; + else { + i = delayMostBytesWanted(mem, INT_MAX); + if (i == 0) + return 1; + i = -(i != INT_MAX); + } #endif if (EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT)) - return 0; + return i; if (mem->inmem_hi - storeLowestMemReaderOffset(e) < READ_AHEAD_GAP) - return 0; + return i; return 1; +#ifndef DELAY_POOLS +#undef i +#endif } void diff -urN squid-2.2.STABLE5/src/redirect.c squid-2.2.STABLE5.DJL1/src/redirect.c --- squid-2.2.STABLE5/src/redirect.c Sun Jan 24 10:22:59 1999 +++ squid-2.2.STABLE5.DJL1/src/redirect.c Thu Oct 21 23:14:19 1999 @@ -139,8 +139,8 @@ cachemgrRegister("redirector", "URL Redirector Stats", redirectStats, 0, 1); + init++; } - init++; } void diff -urN squid-2.2.STABLE5/src/squid.h squid-2.2.STABLE5.DJL1/src/squid.h --- squid-2.2.STABLE5/src/squid.h Tue Apr 13 06:58:20 1999 +++ squid-2.2.STABLE5.DJL1/src/squid.h Thu Oct 21 23:14:19 1999 @@ -175,6 +175,9 @@ #if HAVE_GETOPT_H #include #endif +#if HAVE_LIMITS_H +#include +#endif #if HAVE_DIRENT_H #include diff -urN squid-2.2.STABLE5/src/ssl.c squid-2.2.STABLE5.DJL1/src/ssl.c --- squid-2.2.STABLE5/src/ssl.c Wed Jul 7 09:52:53 1999 +++ squid-2.2.STABLE5.DJL1/src/ssl.c Thu Oct 21 23:14:19 1999 @@ -119,7 +119,14 @@ sslDeferServerRead(int fdnotused, void *data) { SslStateData *s = data; - return delayBytesWanted(s->delay_id, 0, 1) == 0; + int i; + + i = delayBytesWanted(s->delay_id, 0, INT_MAX); + if(i == INT_MAX) + return 0; + if(i == 0) + return 1; + return -1; } #endif