mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
noticed the default max-cache-size [RT #17515]
This commit is contained in:
parent
140a27777d
commit
95c5f1d17b
@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: config.c,v 1.82 2007/10/19 17:15:53 explorer Exp $ */
|
||||
/* $Id: config.c,v 1.83 2008/01/22 00:29:03 jinmei Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@ -129,7 +129,7 @@ options {\n\
|
||||
max-ncache-ttl 10800; /* 3 hours */\n\
|
||||
max-cache-ttl 604800; /* 1 week */\n\
|
||||
transfer-format many-answers;\n\
|
||||
max-cache-size 32M;\n\
|
||||
# max-cache-size default; /* set default in server.c */\n\
|
||||
check-names master fail;\n\
|
||||
check-names slave warn;\n\
|
||||
check-names response ignore;\n\
|
||||
|
@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: server.c,v 1.499 2008/01/18 23:46:57 tbox Exp $ */
|
||||
/* $Id: server.c,v 1.500 2008/01/22 00:29:03 jinmei Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@ -222,6 +222,11 @@ static const struct {
|
||||
{ NULL, ISC_FALSE }
|
||||
};
|
||||
|
||||
/*%
|
||||
* The default max-cache-size
|
||||
*/
|
||||
#define NS_MAXCACHESIZE_DEFAULT 33554432 /*%< Bytes. 33554432 = 32MB */
|
||||
|
||||
static void
|
||||
fatal(const char *msg, isc_result_t result);
|
||||
|
||||
@ -1179,11 +1184,21 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
|
||||
|
||||
obj = NULL;
|
||||
result = ns_config_get(maps, "max-cache-size", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
if (cfg_obj_isstring(obj)) {
|
||||
INSIST(result == ISC_R_SUCCESS || result == ISC_R_NOTFOUND);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
max_cache_size = NS_MAXCACHESIZE_DEFAULT;
|
||||
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_SERVER, ISC_LOG_INFO,
|
||||
"default max-cache-size (%u) applies%s%s",
|
||||
max_cache_size, sep, viewname);
|
||||
} else if (cfg_obj_isstring(obj)) {
|
||||
str = cfg_obj_asstring(obj);
|
||||
INSIST(strcasecmp(str, "unlimited") == 0);
|
||||
max_cache_size = ISC_UINT32_MAX;
|
||||
INSIST(strcasecmp(str, "unlimited") == 0 ||
|
||||
strcasecmp(str, "default") == 0);
|
||||
if (strcasecmp(str, "unlimited") == 0)
|
||||
max_cache_size = ISC_UINT32_MAX;
|
||||
else
|
||||
max_cache_size = NS_MAXCACHESIZE_DEFAULT;
|
||||
} else {
|
||||
isc_resourcevalue_t value;
|
||||
value = cfg_obj_asuint64(obj);
|
||||
|
@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: namedconf.c,v 1.83 2008/01/18 23:46:58 tbox Exp $ */
|
||||
/* $Id: namedconf.c,v 1.84 2008/01/22 00:29:03 jinmei Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@ -764,7 +764,7 @@ view_clauses[] = {
|
||||
{ "max-ncache-ttl", &cfg_type_uint32, 0 },
|
||||
{ "max-cache-ttl", &cfg_type_uint32, 0 },
|
||||
{ "transfer-format", &cfg_type_transferformat, 0 },
|
||||
{ "max-cache-size", &cfg_type_sizenodefault, 0 },
|
||||
{ "max-cache-size", &cfg_type_size, 0 },
|
||||
{ "check-names", &cfg_type_checknames, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "cache-file", &cfg_type_qstring, 0 },
|
||||
{ "suppress-initial-notify", &cfg_type_boolean, CFG_CLAUSEFLAG_NYI },
|
||||
|
Loading…
x
Reference in New Issue
Block a user