mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-27 08:59:19 -05:00
Fixup cache size test for msg cache.
git-svn-id: file:///svn/unbound/trunk@4789 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
d2d7b987fa
commit
5bda4f9822
3 changed files with 5 additions and 5 deletions
|
|
@ -804,8 +804,8 @@ void daemon_apply_cfg(struct daemon* daemon, struct config_file* cfg)
|
|||
daemon->cfg = cfg;
|
||||
config_apply(cfg);
|
||||
if(!daemon->env->msg_cache ||
|
||||
cfg->msg_cache_size != slabhash_get_size(daemon->env->msg_cache) ||
|
||||
cfg->msg_cache_slabs != daemon->env->msg_cache->size) {
|
||||
cfg->msg_cache_slabs != daemon->env->msg_cache->size ||
|
||||
(cfg->msg_cache_size/cfg->msg_cache_slabs)*cfg->msg_cache_slabs != slabhash_get_size(daemon->env->msg_cache)) {
|
||||
slabhash_delete(daemon->env->msg_cache);
|
||||
daemon->env->msg_cache = slabhash_create(cfg->msg_cache_slabs,
|
||||
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ context_finalize(struct ub_ctx* ctx)
|
|||
if(!auth_zones_apply_cfg(ctx->env->auth_zones, cfg, 1))
|
||||
return UB_INITFAIL;
|
||||
if(!ctx->env->msg_cache ||
|
||||
cfg->msg_cache_size != slabhash_get_size(ctx->env->msg_cache) ||
|
||||
cfg->msg_cache_slabs != ctx->env->msg_cache->size) {
|
||||
cfg->msg_cache_slabs != ctx->env->msg_cache->size ||
|
||||
(cfg->msg_cache_size/cfg->msg_cache_slabs)*cfg->msg_cache_slabs != slabhash_get_size(ctx->env->msg_cache)) {
|
||||
slabhash_delete(ctx->env->msg_cache);
|
||||
ctx->env->msg_cache = slabhash_create(cfg->msg_cache_slabs,
|
||||
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
|
||||
|
|
|
|||
2
services/cache/infra.c
vendored
2
services/cache/infra.c
vendored
|
|
@ -302,7 +302,7 @@ infra_adjust(struct infra_cache* infra, struct config_file* cfg)
|
|||
/* divide cachesize by slabs and multiply by slabs, because if the
|
||||
* cachesize is not an even multiple of slabs, that is the resulting
|
||||
* size of the slabhash */
|
||||
if(maxmem != slabhash_get_size(infra->hosts) ||
|
||||
if((maxmem/cfg->infra_cache_slabs)*cfg->infra_cache_slabs != slabhash_get_size(infra->hosts) ||
|
||||
cfg->infra_cache_slabs != infra->hosts->size ||
|
||||
cfg->ratelimit_slabs != infra->domain_rates->size ||
|
||||
(cfg->ratelimit_size/cfg->ratelimit_slabs)*cfg->ratelimit_slabs != slabhash_get_size(infra->domain_rates) ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue