* 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 */
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\
* 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 */
{ 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);
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);
* 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 */
{ "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 },