From ed8daea26475309e1ac8ed8556b7d4ec8ae4432c Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 31 May 2001 10:53:42 +0000 Subject: [PATCH] enforce a minimum cache size of 2mb --- lib/dns/cache.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 4ad1075939..df17195062 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cache.c,v 1.37 2001/04/11 22:15:00 tale Exp $ */ +/* $Id: cache.c,v 1.38 2001/05/31 10:53:42 tale Exp $ */ #include @@ -793,12 +793,11 @@ dns_cache_setcachesize(dns_cache_t *cache, isc_uint32_t size) { REQUIRE(VALID_CACHE(cache)); /* - * Impose a minumum cache size -- this should perhaps be larger, - * but for now is just meant ensure that hiwater and lowater are - * less than the size. + * Impose a minumum cache size; pathological things happen if there + * is too little room. */ - if (size != 0 && size < 8) - size = 8; + if (size != 0 && size < 2097152) + size = 2097152; /* 2mb */ hiwater = size - (size >> 3); /* ~(7/8) */ lowater = size - (size >> 2); /* ~(3/4) */