]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- added fqdncache_size configuration option
authorwessels <>
Sun, 30 Aug 1998 11:21:38 +0000 (11:21 +0000)
committerwessels <>
Sun, 30 Aug 1998 11:21:38 +0000 (11:21 +0000)
- added MD5 hashes to mem pools
- removed some DONT code

src/cf.data.pre
src/client_side.cc
src/enums.h
src/fqdncache.cc
src/mem.cc
src/store_key_md5.cc
src/structs.h

index c2ebaac2853e17fd4895cee5df16453f167d887e..50a358df7993a47d994d3aada8ae62922d24fd2f 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.100 1998/08/21 04:03:45 wessels Exp $
+# $Id: cf.data.pre,v 1.101 1998/08/30 05:21:38 wessels Exp $
 #
 #
 # SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -546,6 +546,16 @@ ipcache_low  90
 ipcache_high 95
 DOC_END
 
+NAME: fqdncache_size
+COMMENT: (number of entries)
+TYPE: int
+DEFAULT: 1024
+LOC: Config.fqdncache.size
+DOC_START
+       Maximum number of FQDN cache entries.
+fqdncache_size 1024
+DOC_END
+
 COMMENT_START
  LOGFILE PATHNAMES AND CACHE DIRECTORIES
  -----------------------------------------------------------------------------
index 874dc89c87449fd5d0cbebfbc7467ccb734f012b..e0fa8700878bbab9900395fa252065243772eb52 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.389 1998/08/27 06:28:55 wessels Exp $
+ * $Id: client_side.cc,v 1.390 1998/08/30 05:21:39 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1510,6 +1510,9 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da
            kb_incr(&Counter.client_http.hit_kbytes_out, size);
     }
     if (errflag) {
+       /*
+        * just close the socket, httpRequestFree will abort if needed
+        */
        comm_close(fd);
     } else if (NULL == entry) {
        comm_close(fd);         /* yuk */
index 0d68c9a37cd95536d81a7adb72110530c24e42d7..075a62caf68b389879d131ba15c72e7792f4ffc8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: enums.h,v 1.125 1998/08/26 05:36:43 wessels Exp $
+ * $Id: enums.h,v 1.126 1998/08/30 05:21:40 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -589,6 +589,7 @@ typedef enum {
     MEM_DLINK_LIST,
     MEM_STATCOUNTERS,
     MEM_CLIENT_INFO,
+    MEM_MD5_DIGEST,
     MEM_MAX
 } mem_type;
 
index f8e26bd505822aee29d98b300e90578110b46fbf..5f1c3790368fc68598cefa795a8da24d317dc654 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: fqdncache.cc,v 1.112 1998/08/21 08:41:56 wessels Exp $
+ * $Id: fqdncache.cc,v 1.113 1998/08/30 05:21:41 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -36,9 +36,6 @@
 
 #include "squid.h"
 
-#define MAX_LINELEN (4096)
-
-#define MAX_FQDN                1024   /* Maximum cached FQDN */
 #define FQDN_LOW_WATER       90
 #define FQDN_HIGH_WATER      95
 
@@ -547,9 +544,9 @@ fqdncache_init(void)
     debug(35, 3) ("Initializing FQDN Cache...\n");
     memset(&FqdncacheStats, '\0', sizeof(FqdncacheStats));
     memset(&lru_list, '\0', sizeof(lru_list));
-    fqdncache_high = (long) (((float) MAX_FQDN *
+    fqdncache_high = (long) (((float) Config.fqdncache.size *
            (float) FQDN_HIGH_WATER) / (float) 100);
-    fqdncache_low = (long) (((float) MAX_FQDN *
+    fqdncache_low = (long) (((float) Config.fqdncache.size *
            (float) FQDN_LOW_WATER) / (float) 100);
     n = hashPrime(fqdncache_high / 4);
     fqdn_table = hash_create((HASHCMP *) strcmp, n, hash4);
@@ -790,9 +787,9 @@ fqdncache_restart(void)
        if (this->status == FQDN_NEGATIVE_CACHED)
            continue;
     }
-    fqdncache_high = (long) (((float) MAX_FQDN *
+    fqdncache_high = (long) (((float) Config.fqdncache.size *
            (float) FQDN_HIGH_WATER) / (float) 100);
-    fqdncache_low = (long) (((float) MAX_FQDN *
+    fqdncache_low = (long) (((float) Config.fqdncache.size *
            (float) FQDN_LOW_WATER) / (float) 100);
 }
 
index 91d4b4f4f2197d3104973c7ed99900ad4c724f4e..34ec1d553fbc861697a1b72d3a517450db3dcaa9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mem.cc,v 1.33 1998/08/27 06:28:56 wessels Exp $
+ * $Id: mem.cc,v 1.34 1998/08/30 05:21:42 wessels Exp $
  *
  * DEBUG: section 13    High Level Memory Pool Management
  * AUTHOR: Harvest Derived
@@ -277,6 +277,7 @@ memInit(void)
     memDataInit(MEM_USHORTLIST, "ushort_list", sizeof(ushortlist), 0);
     memDataInit(MEM_WORDLIST, "wordlist", sizeof(wordlist), 0);
     memDataInit(MEM_CLIENT_INFO, "ClientInfo", sizeof(ClientInfo), 0);
+    memDataInit(MEM_MD5_DIGEST, "MD5 digest", MD5_DIGEST_CHARS, 0);
     /* test that all entries are initialized */
     for (t = MEM_NONE, t++; t < MEM_MAX; t++) {
        if (MEM_DONTFREE == t)
index 545ad080bffe572018d8bc8c2f5bafde14bcf02b..a8b99ef0156eadfb272039b5ae3649cc1bd2c749 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_key_md5.cc,v 1.12 1998/08/26 19:08:57 wessels Exp $
+ * $Id: store_key_md5.cc,v 1.13 1998/08/30 05:21:42 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager MD5 Cache Keys
  * AUTHOR: Duane Wessels
@@ -130,9 +130,8 @@ storeKeyPublic(const char *url, method_t method)
 const cache_key *
 storeKeyDup(const cache_key * key)
 {
-    cache_key *dup = xmalloc(MD5_DIGEST_CHARS);
+    cache_key *dup = memAllocate(MEM_MD5_DIGEST);
     xmemcpy(dup, key, MD5_DIGEST_CHARS);
-    /* XXX account key */
     return dup;
 }
 
@@ -147,7 +146,6 @@ void
 storeKeyFree(const cache_key * key)
 {
     xfree((void *) key);
-    /* XXX account key */
 }
 
 int
index ac11b9821354f9bbda14adc3b06c5537807c36e9..8972f1d15ada72fe07a5b4e3790066064aa7646d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.213 1998/08/27 22:01:12 rousskov Exp $
+ * $Id: structs.h,v 1.214 1998/08/30 05:21:43 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -330,6 +330,9 @@ struct _SquidConfig {
        int low;
        int high;
     } ipcache;
+    struct {
+       int size;
+    } fqdncache;
     int minDirectHops;
     cachemgr_passwd *passwd_list;
     struct {