mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-26 16:47:31 -04:00
Rename cache-size config option to max-cache-size and change argument
type to be strict integer (no 'default' or 'unlimited')..
This commit is contained in:
parent
29196ffb72
commit
47c196192a
7 changed files with 40 additions and 45 deletions
4
CHANGES
4
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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 <config.h>
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 <config.h>
|
||||
|
||||
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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 <config.h>
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue