From: wessels <> Date: Sun, 30 Aug 1998 11:21:38 +0000 (+0000) Subject: - added fqdncache_size configuration option X-Git-Tag: SQUID_3_0_PRE1~2777 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e55650e37a022a8af864383030201a0910f520c3;p=thirdparty%2Fsquid.git - added fqdncache_size configuration option - added MD5 hashes to mem pools - removed some DONT code --- diff --git a/src/cf.data.pre b/src/cf.data.pre index c2ebaac285..50a358df79 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 ----------------------------------------------------------------------------- diff --git a/src/client_side.cc b/src/client_side.cc index 874dc89c87..e0fa870087 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 */ diff --git a/src/enums.h b/src/enums.h index 0d68c9a37c..075a62caf6 100644 --- a/src/enums.h +++ b/src/enums.h @@ -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; diff --git a/src/fqdncache.cc b/src/fqdncache.cc index f8e26bd505..5f1c379036 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -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); } diff --git a/src/mem.cc b/src/mem.cc index 91d4b4f4f2..34ec1d553f 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -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) diff --git a/src/store_key_md5.cc b/src/store_key_md5.cc index 545ad080bf..a8b99ef015 100644 --- a/src/store_key_md5.cc +++ b/src/store_key_md5.cc @@ -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 diff --git a/src/structs.h b/src/structs.h index ac11b98213..8972f1d15a 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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 {