]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
s/FD_SETSIZE|SQUID_FD_SETSIZE/SQUID_MAXFD/
authorwessels <>
Fri, 22 Nov 1996 12:07:07 +0000 (12:07 +0000)
committerwessels <>
Fri, 22 Nov 1996 12:07:07 +0000 (12:07 +0000)
12 files changed:
ChangeLog
configure
configure.in
include/autoconf.h.in
src/comm.cc
src/disk.cc
src/ftp.cc
src/main.cc
src/squid.h
src/stat.cc
src/stmem.cc
src/tools.cc

index c751eeaa60993d7b9ad01aadfda2a3150f56e6fd..e8d08db0a02345f4c24b64814b7cb2ce263e45fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,19 @@
-
-Changes to squid-1.1.beta20 (November 13, 1996):
+       - Fixed setting entry->timestamp for NOT MODIFIED replies.
+       - Changed old HTTP/1.1 Forwarded: header to new Via:.
+       - Changed urlCheckRequest() to allow all FTP requests, including
+         PUT which should get handled by the passthrough module.
+       - Fixed needlessly calling storeSwapFullPath() in
+         storeSwapOutHandle() (Mark Treacy).
+       - Simplified hash linking (Mark Treacy).
+       - Write pid_filename by default (Markus Gyger).
+       - Changed "Invalid dnsserver output" to non-fatal debug_trap()
+         (Joe Ramey).
+       - Changed STORE_IN_MEM_BUCKETS to the prime 229 (Neil Murray).
+
+Changes to squid-1.1.beta20 (November 17, 1996):
 
        - Changed neighbor_domain_type to neighbor_type_domain in
          squid.conf.
-       - Protect squid_error_entry() calls with check that store_status
-         == STORE_PENDING.
        - Changed all 'xstrerror' debug messages to section 50.
        - More const fixes (Markus Gyger).
        - Added xstrncpy() which null-terminates (Markus Gyger).
index 0be1a12152a4f50374be04d89433e111eef460c3..2400945ffad4428c6098242af945d5bac9e935a1 100755 (executable)
--- a/configure
+++ b/configure
@@ -517,7 +517,7 @@ fi
 
 
 
-# From configure.in Revision: 1.47 
+# From configure.in Revision: 1.48 
 ac_aux_dir=
 for ac_dir in aux $srcdir/aux; do
   if test -f $ac_dir/install-sh; then
@@ -2613,7 +2613,7 @@ done
 
 echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6
 if test "$cross_compiling" = yes; then
-  SQUID_FD_SETSIZE=256
+  SQUID_MAXFD=256
 else
 cat > conftest.$ac_ext <<EOF
 #line 2620 "configure"
@@ -2669,15 +2669,15 @@ main() {
 EOF
 eval $ac_link
 if test -s conftest && (./conftest; exit) 2>/dev/null; then
-  SQUID_FD_SETSIZE=`cat conftestval`
+  SQUID_MAXFD=`cat conftestval`
 else
-  SQUID_FD_SETSIZE=256
+  SQUID_MAXFD=256
 fi
 fi
 rm -fr conftest*
-echo "$ac_t""$SQUID_FD_SETSIZE" 1>&6
+echo "$ac_t""$SQUID_MAXFD" 1>&6
 cat >> confdefs.h <<EOF
-#define SQUID_FD_SETSIZE $SQUID_FD_SETSIZE
+#define SQUID_MAXFD $SQUID_MAXFD
 EOF
 
 
index d18b5fe65676868e0adfe02538b2240804c60b39..835f889e17e11e1b45a0832e264026e81beb5c45 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.48 1996/11/15 07:50:22 wessels Exp $
+dnl  $Id: configure.in,v 1.49 1996/11/22 05:07:09 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.48 $)dnl
+AC_REVISION($Revision: 1.49 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -386,11 +386,11 @@ main() {
        exit(0);
 }
 ],
-SQUID_FD_SETSIZE=`cat conftestval`,
-SQUID_FD_SETSIZE=256,
-SQUID_FD_SETSIZE=256)
-AC_MSG_RESULT($SQUID_FD_SETSIZE)
-AC_DEFINE_UNQUOTED(SQUID_FD_SETSIZE, $SQUID_FD_SETSIZE)
+SQUID_MAXFD=`cat conftestval`,
+SQUID_MAXFD=256,
+SQUID_MAXFD=256)
+AC_MSG_RESULT($SQUID_MAXFD)
+AC_DEFINE_UNQUOTED(SQUID_MAXFD, $SQUID_MAXFD)
 
 AC_MSG_CHECKING(Default UDP send buffer size)
 AC_TRY_RUN([
index ab67fcb8f823996d8dd22f2a0a8ec79bded48a22..1cfd855a670d7188694f01effc26914e11baff42 100644 (file)
@@ -44,7 +44,7 @@
 #undef HAVE_EXT_MALLINFO
 
 /* Maximum number of open filedescriptors */
-#undef SQUID_FD_SETSIZE
+#undef SQUID_MAXFD
 
 /* UDP send buffer size */
 #undef SQUID_UDP_SO_SNDBUF
index 7ab363107896d067eb3dddefbbcda706ff2a6624..594984e997385ce7d1b86cd42e8e337735442ef3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.106 1996/11/15 00:36:16 wessels Exp $
+ * $Id: comm.cc,v 1.107 1996/11/22 05:07:12 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -296,7 +296,7 @@ comm_open(int sock_type,
 }
 
    /*
-    * NOTE: set the listen queue to FD_SETSIZE/4 and rely on the kernel to      
+    * NOTE: set the listen queue to SQUID_MAXFD/4 and rely on the kernel to      
     * impose an upper limit.  Solaris' listen(3n) page says it has   
     * no limit on this parameter, but sys/socket.h sets SOMAXCONN 
     * to 5.  HP-UX currently has a limit of 20.  SunOS is 5 and
@@ -306,9 +306,9 @@ int
 comm_listen(int sock)
 {
     int x;
-    if ((x = listen(sock, FD_SETSIZE >> 2)) < 0) {
+    if ((x = listen(sock, SQUID_MAXFD >> 2)) < 0) {
        debug(50, 0, "comm_listen: listen(%d, %d): %s\n",
-           FD_SETSIZE >> 2,
+           SQUID_MAXFD >> 2,
            sock, xstrerror());
        return x;
     }
@@ -360,7 +360,7 @@ int
 comm_set_fd_lifetime(int fd, int lifetime)
 {
     debug(5, 3, "comm_set_fd_lifetime: FD %d lft %d\n", fd, lifetime);
-    if (fd < 0 || fd > FD_SETSIZE)
+    if (fd < 0 || fd > SQUID_MAXFD)
        return 0;
     if (lifetime < 0)
        return fd_lifetime[fd] = -1;
@@ -520,7 +520,7 @@ comm_close(int fd)
 {
     FD_ENTRY *conn = NULL;
     debug(5, 5, "comm_close: FD %d\n", fd);
-    if (fd < 0 || fd >= FD_SETSIZE)
+    if (fd < 0 || fd >= SQUID_MAXFD)
        return;
     conn = &fd_table[fd];
     if (!conn->openned)
@@ -1008,17 +1008,17 @@ comm_init(void)
 {
     int i;
 
-    fd_table = xcalloc(FD_SETSIZE, sizeof(FD_ENTRY));
-    meta_data.misc += FD_SETSIZE * sizeof(FD_ENTRY);
+    fd_table = xcalloc(SQUID_MAXFD, sizeof(FD_ENTRY));
+    meta_data.misc += SQUID_MAXFD * sizeof(FD_ENTRY);
     /* Keep a few file descriptors free so that we don't run out of FD's
      * after accepting a client but before it opens a socket or a file.
-     * Since FD_SETSIZE can be as high as several thousand, don't waste them */
-    RESERVED_FD = min(100, FD_SETSIZE / 4);
+     * Since SQUID_MAXFD can be as high as several thousand, don't waste them */
+    RESERVED_FD = min(100, SQUID_MAXFD / 4);
     /* hardwired lifetimes */
-    fd_lifetime = xmalloc(sizeof(int) * FD_SETSIZE);
-    for (i = 0; i < FD_SETSIZE; i++)
+    fd_lifetime = xmalloc(sizeof(int) * SQUID_MAXFD);
+    for (i = 0; i < SQUID_MAXFD; i++)
        comm_set_fd_lifetime(i, -1);    /* denotes invalid */
-    meta_data.misc += FD_SETSIZE * sizeof(int);
+    meta_data.misc += SQUID_MAXFD * sizeof(int);
     zero_tv.tv_sec = 0;
     zero_tv.tv_usec = 0;
     return 0;
@@ -1048,7 +1048,7 @@ examine_select(fd_set * readfds, fd_set * writefds)
     FD_ENTRY *f = NULL;
 
     debug(5, 0, "examine_select: Examining open file descriptors...\n");
-    for (fd = 0; fd < FD_SETSIZE; fd++) {
+    for (fd = 0; fd < SQUID_MAXFD; fd++) {
        FD_ZERO(&read_x);
        FD_ZERO(&write_x);
        tv.tv_sec = tv.tv_usec = 0;
@@ -1058,7 +1058,7 @@ examine_select(fd_set * readfds, fd_set * writefds)
            FD_SET(fd, &write_x);
        else
            continue;
-       num = select(FD_SETSIZE, &read_x, &write_x, NULL, &tv);
+       num = select(SQUID_MAXFD, &read_x, &write_x, NULL, &tv);
        if (num > -1) {
            debug(5, 5, "FD %d is valid.\n", fd);
            continue;
@@ -1115,7 +1115,7 @@ checkTimeouts(void)
     FD_ENTRY *f = NULL;
     void *data;
     /* scan for timeout */
-    for (fd = 0; fd < FD_SETSIZE; ++fd) {
+    for (fd = 0; fd < SQUID_MAXFD; ++fd) {
        f = &fd_table[fd];
        if ((hdl = f->timeout_handler) == NULL)
            continue;
@@ -1138,7 +1138,7 @@ checkLifetimes(void)
 
     PF hdl = NULL;
 
-    for (fd = 0; fd < FD_SETSIZE; fd++) {
+    for (fd = 0; fd < SQUID_MAXFD; fd++) {
        if ((lft = comm_get_fd_lifetime(fd)) == -1)
            continue;
        if (lft > squid_curtime)
@@ -1177,12 +1177,12 @@ checkLifetimes(void)
 static void
 Reserve_More_FDs(void)
 {
-    if (RESERVED_FD < FD_SETSIZE - 64) {
+    if (RESERVED_FD < SQUID_MAXFD - 64) {
        RESERVED_FD = RESERVED_FD + 1;
-    } else if (RESERVED_FD == FD_SETSIZE - 64) {
+    } else if (RESERVED_FD == SQUID_MAXFD - 64) {
        RESERVED_FD = RESERVED_FD + 1;
        debug(5, 0, "Don't you have a tiny open-file table size of %d\n",
-           FD_SETSIZE - RESERVED_FD);
+           SQUID_MAXFD - RESERVED_FD);
     }
 }
 
index 490b1ed1c1c84c0457436eec6f4e7833506b894a..aef7b796de373d49a824b332774537894ae0f8cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.43 1996/11/15 00:36:17 wessels Exp $
+ * $Id: disk.cc,v 1.44 1996/11/22 05:07:12 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -131,9 +131,9 @@ disk_init(void)
 {
     int fd;
 
-    file_table = xcalloc(FD_SETSIZE, sizeof(FileEntry));
-    meta_data.misc += FD_SETSIZE * sizeof(FileEntry);
-    for (fd = 0; fd < FD_SETSIZE; fd++) {
+    file_table = xcalloc(SQUID_MAXFD, sizeof(FileEntry));
+    meta_data.misc += SQUID_MAXFD * sizeof(FileEntry);
+    for (fd = 0; fd < SQUID_MAXFD; fd++) {
        file_table[fd].filename[0] = '\0';
        file_table[fd].at_eof = NO;
        file_table[fd].open_stat = FILE_NOT_OPEN;
index 0e16bd0c13195ba97275ee2f8289a5bc44523cbf..e8df9b17f6f010923352de1391d83cecb9dd5ead 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.84 1996/11/15 17:26:19 wessels Exp $
+ * $Id: ftp.cc,v 1.85 1996/11/22 05:07:13 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -728,7 +728,7 @@ ftpInitialize(void)
        return -1;
     }
     ftpget_port = ntohs(S.sin_port);
-    listen(cfd, FD_SETSIZE >> 2);
+    listen(cfd, SQUID_MAXFD >> 2);
     if ((pid = fork()) < 0) {
        debug(50, 0, "ftpInitialize: fork: %s\n", xstrerror());
        comm_close(cfd);
index 81b8872415bad18f1c758e35f9bfd1c380e02162..4ff1270184b97221c61a2d68ffd8faab532675e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.cc,v 1.114 1996/11/15 00:36:21 wessels Exp $
+ * $Id: main.cc,v 1.115 1996/11/22 05:07:14 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -494,7 +494,7 @@ mainInitialize(void)
     debug(1, 0, "Starting Squid Cache version %s for %s...\n",
        version_string,
        CONFIG_HOST_TYPE);
-    debug(1, 1, "With %d file descriptors available\n", FD_SETSIZE);
+    debug(1, 1, "With %d file descriptors available\n", SQUID_MAXFD);
 
     if (first_time) {
        stmemInit();            /* stmem must go before at least redirect */
@@ -599,7 +599,7 @@ main(int argc, char **argv)
     setMaxFD();
 
     if (opt_catch_signals)
-       for (n = FD_SETSIZE; n > 2; n--)
+       for (n = SQUID_MAXFD; n > 2; n--)
            close(n);
 
     /*init comm module */
index 5ee1b93351c7526a1a2246a6ebeb184d2270df1a..a4204c90b6d98dfdb06a60f7dd26a2ad4d061bc4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: squid.h,v 1.74 1996/11/12 22:37:16 wessels Exp $
+ * $Id: squid.h,v 1.75 1996/11/22 05:07:15 wessels Exp $
  *
  * AUTHOR: Duane Wessels
  *
 
 #include "config.h"
 
-#if SQUID_FD_SETSIZE > 256
-#define FD_SETSIZE SQUID_FD_SETSIZE
-#endif
-
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index e9e3dca1854eee2345be928c6d636431596cb262..8b538e34a0e97516ecf53aa44a661a29be722d6d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.105 1996/11/15 00:36:22 wessels Exp $
+ * $Id: stat.cc,v 1.106 1996/11/22 05:07:15 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -643,7 +643,7 @@ statFiledescriptors(StoreEntry * sentry)
        "Remote Address",
        "Description");
     storeAppendPrintf(sentry, "{---- ------ ---- ---- --------------------- ------------------------------}\n");
-    for (i = 0; i < FD_SETSIZE; i++) {
+    for (i = 0; i < SQUID_MAXFD; i++) {
        if (!fdstat_isopen(i))
            continue;
        j = fdstatGetType(i);
@@ -825,7 +825,7 @@ info_get(const cacheinfo * obj, StoreEntry * sentry)
 
     storeAppendPrintf(sentry, "{File descriptor usage for %s:}\n", appname);
     storeAppendPrintf(sentry, "{\tMax number of file desc available:    %4d}\n",
-       FD_SETSIZE);
+       SQUID_MAXFD);
     storeAppendPrintf(sentry, "{\tLargest file desc currently in use:   %4d}\n",
        fdstat_biggest_fd());
     storeAppendPrintf(sentry, "{\tAvailable number of file descriptors: %4d}\n",
index ccf7c5cf60bf4cd3969929f2c397d457c846209b..b3b1d98e17bde46fcc773930835474824a2a124f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stmem.cc,v 1.33 1996/11/06 23:14:59 wessels Exp $
+ * $Id: stmem.cc,v 1.34 1996/11/22 05:07:16 wessels Exp $
  *
  * DEBUG: section 19    Memory Primitives
  * AUTHOR: Harvest Derived
@@ -421,12 +421,12 @@ stmemInit(void)
     request_pool.page_size = sizeof(request_t);
     request_pool.total_pages_allocated = 0;
     request_pool.n_pages_in_use = 0;
-    request_pool.max_pages = FD_SETSIZE >> 3;
+    request_pool.max_pages = SQUID_MAXFD >> 3;
 
     mem_obj_pool.page_size = sizeof(MemObject);
     mem_obj_pool.total_pages_allocated = 0;
     mem_obj_pool.n_pages_in_use = 0;
-    mem_obj_pool.max_pages = FD_SETSIZE >> 3;
+    mem_obj_pool.max_pages = SQUID_MAXFD >> 3;
 
 #if PURIFY
     debug(19, 0, "Disabling stacks under purify\n");
index 9987f293f5d4f7108e267ccc450a929e32d7d3d8..d2268884e155ef806f2415e2f4043adfc6be5636 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.84 1996/11/19 07:21:15 wessels Exp $
+ * $Id: tools.cc,v 1.85 1996/11/22 05:07:17 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -584,7 +584,7 @@ setMaxFD(void)
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
        debug(50, 0, "setrlimit: RLIMIT_NOFILE: %s\n", xstrerror());
     } else {
-       rl.rlim_cur = FD_SETSIZE;
+       rl.rlim_cur = SQUID_MAXFD;
        if (rl.rlim_cur > rl.rlim_max)
            rl.rlim_cur = rl.rlim_max;
        if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
@@ -596,7 +596,7 @@ setMaxFD(void)
     if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
        debug(50, 0, "setrlimit: RLIMIT_NOFILE: %s\n", xstrerror());
     } else {
-       rl.rlim_cur = FD_SETSIZE;
+       rl.rlim_cur = SQUID_MAXFD;
        if (rl.rlim_cur > rl.rlim_max)
            rl.rlim_cur = rl.rlim_max;
        if (setrlimit(RLIMIT_OFILE, &rl) < 0) {