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,
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,
/* 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) ||