diff --git a/CHANGES b/CHANGES index 16e4f00dd1..59127a4ee1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ + 247. [cleanup] Rename cache-size config option to max-cache-size. + 246. [func] Rename global option cachesize to cache-size and - add corresponding option to view statement. + add corresponding option to view statement. 245. [bug] If an uncompressed name will take more than 255 characters and the buffer is sufficiently long, diff --git a/bin/tests/named.conf b/bin/tests/named.conf index e042632830..49984f6d1e 100644 --- a/bin/tests/named.conf +++ b/bin/tests/named.conf @@ -150,7 +150,7 @@ options { coresize 100; datasize 101; files 230; - cache-size 20m; + max-cache-size 200000; stacksize 231; cleaning-interval 1000; heartbeat-interval 1001; @@ -234,7 +234,7 @@ view "test-view" in { foo.com. 4 3 2 "abdefghijklmnopqrstuvwxyz"; }; sig-validity-interval 45; - cache-size unlimited; + max-cache-size 100000; allow-query { 10.0.0.30;}; match-clients { 10.0.0.1 ; }; check-names master warn; diff --git a/lib/dns/config/confctx.c b/lib/dns/config/confctx.c index 1f873a0a75..2b89f6f69f 100644 --- a/lib/dns/config/confctx.c +++ b/lib/dns/config/confctx.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confctx.c,v 1.65 2000/06/09 08:48:38 brister Exp $ */ +/* $Id: confctx.c,v 1.66 2000/06/09 15:03:22 brister Exp $ */ #include @@ -424,14 +424,6 @@ dns_c_checkconfig(dns_c_ctx_t *cfg) } - if (dns_c_ctx_getcachesize(cfg, &uintval) != ISC_R_NOTFOUND) { - isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG, - DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING, - "option 'cachesize' is not yet " - "implemented"); - } - - if (dns_c_ctx_getstacksize(cfg, &uintval) != ISC_R_NOTFOUND) { isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG, DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING, @@ -955,13 +947,12 @@ dns_c_ctx_optionsprint(FILE *fp, int indent, dns_c_options_t *options) PRINT_INTEGER(min_roots, "min-roots"); PRINT_INTEGER(serial_queries, "serial-queries"); PRINT_INTEGER(sig_valid_interval, "sig-validity-interval"); - + PRINT_INTEGER(max_cache_size, "max-cache-size"); PRINT_AS_SIZE_CLAUSE(data_size, "datasize"); PRINT_AS_SIZE_CLAUSE(stack_size, "stacksize"); PRINT_AS_SIZE_CLAUSE(core_size, "coresize"); PRINT_AS_SIZE_CLAUSE(files, "files"); - PRINT_AS_SIZE_CLAUSE(cache_size, "cache-size"); PRINT_INTEGER(max_ncache_ttl, "max-ncache-ttl"); PRINT_INTEGER(max_cache_ttl, "max-cache-ttl"); @@ -1450,7 +1441,7 @@ dns_c_ctx_optionsnew(isc_mem_t *mem, dns_c_options_t **options) opts->stack_size = NULL; opts->core_size = NULL; opts->files = NULL; - opts->cache_size = NULL; + opts->max_cache_size = NULL; opts->max_ncache_ttl = NULL; opts->max_cache_ttl = NULL; @@ -1604,7 +1595,7 @@ dns_c_ctx_optionsdelete(dns_c_options_t **opts) FREEFIELD(stack_size); FREEFIELD(core_size); FREEFIELD(files); - FREEFIELD(cache_size); + FREEFIELD(max_cache_size); FREEFIELD(max_ncache_ttl); FREEFIELD(max_cache_ttl); @@ -1828,9 +1819,9 @@ SETUINT32(files, files) UNSETUINT32(files, files) -GETUINT32(cachesize, cache_size) -SETUINT32(cachesize, cache_size) -UNSETUINT32(cachesize, cache_size) +GETUINT32(maxcachesize, max_cache_size) +SETUINT32(maxcachesize, max_cache_size) +UNSETUINT32(maxcachesize, max_cache_size) GETUINT32(maxncachettl, max_ncache_ttl) diff --git a/lib/dns/config/confparser.y b/lib/dns/config/confparser.y index 6535447e17..e78d714eaa 100644 --- a/lib/dns/config/confparser.y +++ b/lib/dns/config/confparser.y @@ -16,7 +16,7 @@ * SOFTWARE. */ -/* $Id: confparser.y,v 1.94 2000/06/09 08:48:39 brister Exp $ */ +/* $Id: confparser.y,v 1.95 2000/06/09 15:03:24 brister Exp $ */ #include @@ -242,7 +242,7 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult); %token L_BANG %token L_BLACKHOLE %token L_BOGUS -%token L_CACHE_SIZE +%token L_MAX_CACHE_SIZE %token L_CATEGORY %token L_CHANNEL %token L_CHECK_NAMES @@ -1919,14 +1919,16 @@ size_clause: L_DATASIZE size_spec YYABORT; } } - | L_CACHE_SIZE size_spec + | L_MAX_CACHE_SIZE L_INTEGER { - tmpres = dns_c_ctx_setcachesize(currcfg, $2); + tmpres = dns_c_ctx_setmaxcachesize(currcfg, $2); if (tmpres == ISC_R_EXISTS) { - parser_error(ISC_FALSE, "cannot redefine cache-size"); + parser_error(ISC_FALSE, + "cannot redefine max-cache-size"); YYABORT; } else if (tmpres != ISC_R_SUCCESS) { - parser_error(ISC_FALSE, "failed to set cache-size"); + parser_error(ISC_FALSE, + "failed to set max-cache-size"); YYABORT; } } @@ -3782,20 +3784,20 @@ view_option: L_FORWARD zone_forward_opt YYABORT; } } - | L_CACHE_SIZE size_spec + | L_MAX_CACHE_SIZE L_INTEGER { dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg); INSIST(view != NULL); - tmpres = dns_c_view_setcachesize(view, $2); + tmpres = dns_c_view_setmaxcachesize(view, $2); if (tmpres == ISC_R_EXISTS) { parser_error(ISC_FALSE, - "cannot redefine view cache-size"); + "cannot redefine view max-cache-size"); YYABORT; } else if (tmpres != ISC_R_SUCCESS) { parser_error(ISC_FALSE, - "failed to set view cache-size"); + "failed to set view max-cache-size"); YYABORT; } } @@ -5018,7 +5020,7 @@ static struct token keyword_tokens [] = { { "auth-nxdomain", L_AUTH_NXDOMAIN }, { "blackhole", L_BLACKHOLE }, { "bogus", L_BOGUS }, - { "cache-size", L_CACHE_SIZE }, + { "max-cache-size", L_MAX_CACHE_SIZE }, { "category", L_CATEGORY }, { "class", L_CLASS }, { "channel", L_CHANNEL }, diff --git a/lib/dns/config/confview.c b/lib/dns/config/confview.c index b52b3881d7..035e82e315 100644 --- a/lib/dns/config/confview.c +++ b/lib/dns/config/confview.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confview.c,v 1.34 2000/06/09 08:48:41 brister Exp $ */ +/* $Id: confview.c,v 1.35 2000/06/09 15:03:25 brister Exp $ */ #include @@ -483,7 +483,7 @@ dns_c_view_new(isc_mem_t *mem, const char *name, dns_rdataclass_t viewclass, view->max_ncache_ttl = NULL; view->max_cache_ttl = NULL; view->sig_valid_interval = NULL; - view->cache_size = NULL; + view->max_cache_size = NULL; view->additional_data = NULL; view->transfer_format = NULL; @@ -678,7 +678,7 @@ dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view) { PRINT_INT32(max_cache_ttl, "max-cache-ttl"); PRINT_INT32(sig_valid_interval, "sig-validity-interval"); - PRINT_AS_SIZE_CLAUSE(cache_size, "cache-size"); + PRINT_INT32(max_cache_size, "max-cache-size"); if (view->additional_data != NULL) { dns_c_printtabs(fp, indent + 1); @@ -811,7 +811,7 @@ dns_c_view_delete(dns_c_view_t **viewptr) { FREEFIELD(max_ncache_ttl); FREEFIELD(max_cache_ttl); FREEFIELD(sig_valid_interval); - FREEFIELD(cache_size); + FREEFIELD(max_cache_size); FREEFIELD(additional_data); FREEFIELD(transfer_format); @@ -1514,9 +1514,9 @@ GETUINT32(sigvalidityinterval, sig_valid_interval) UNSETUINT32(sigvalidityinterval, sig_valid_interval) -GETUINT32(cachesize, cache_size) -SETUINT32(cachesize, cache_size) -UNSETUINT32(cachesize, cache_size) +GETUINT32(maxcachesize, max_cache_size) +SETUINT32(maxcachesize, max_cache_size) +UNSETUINT32(maxcachesize, max_cache_size) GETBYTYPE(dns_c_addata_t, additionaldata, additional_data) diff --git a/lib/dns/include/dns/confctx.h b/lib/dns/include/dns/confctx.h index 2ccad0bde5..6cde6b3ab2 100644 --- a/lib/dns/include/dns/confctx.h +++ b/lib/dns/include/dns/confctx.h @@ -142,7 +142,7 @@ struct dns_c_options { isc_uint32_t *stack_size; isc_uint32_t *core_size; isc_uint32_t *files; - isc_uint32_t *cache_size; + isc_uint32_t *max_cache_size; isc_uint32_t *max_ncache_ttl; isc_uint32_t *max_cache_ttl; @@ -449,9 +449,9 @@ isc_result_t dns_c_ctx_getfiles(dns_c_ctx_t *cfg, isc_uint32_t *retval); isc_result_t dns_c_ctx_unsetfiles(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setcachesize(dns_c_ctx_t *cfg, isc_uint32_t newval); -isc_result_t dns_c_ctx_getcachesize(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_unsetcachesize(dns_c_ctx_t *cfg); +isc_result_t dns_c_ctx_setmaxcachesize(dns_c_ctx_t *cfg, isc_uint32_t newval); +isc_result_t dns_c_ctx_getmaxcachesize(dns_c_ctx_t *cfg, isc_uint32_t *retval); +isc_result_t dns_c_ctx_unsetmaxcachesize(dns_c_ctx_t *cfg); isc_result_t dns_c_ctx_setmaxncachettl(dns_c_ctx_t *cfg, isc_uint32_t newval); diff --git a/lib/dns/include/dns/confview.h b/lib/dns/include/dns/confview.h index e55019355d..55f986f179 100644 --- a/lib/dns/include/dns/confview.h +++ b/lib/dns/include/dns/confview.h @@ -136,7 +136,7 @@ struct dns_c_view { isc_uint32_t *max_ncache_ttl; isc_uint32_t *max_cache_ttl; isc_uint32_t *sig_valid_interval; - isc_uint32_t *cache_size; + isc_uint32_t *max_cache_size; dns_c_addata_t *additional_data; dns_transfer_format_t *transfer_format; @@ -440,11 +440,11 @@ isc_result_t dns_c_view_unsetsigvalidityinterval(dns_c_view_t *view); -isc_result_t dns_c_view_getcachesize(dns_c_view_t *view, +isc_result_t dns_c_view_getmaxcachesize(dns_c_view_t *view, isc_uint32_t *retval); -isc_result_t dns_c_view_setcachesize(dns_c_view_t *view, +isc_result_t dns_c_view_setmaxcachesize(dns_c_view_t *view, isc_uint32_t newval); -isc_result_t dns_c_view_unsetcachesize(dns_c_view_t *view); +isc_result_t dns_c_view_unsetmaxcachesize(dns_c_view_t *view);