From 4af730847cabedcad74d8ec3a566600d2a30b627 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 13 Jun 2013 08:26:41 +0000 Subject: [PATCH] - get_option, set_option, unbound-checkconf -o and libunbound getoption and setoption support cache-min-ttl and cache-max-ttl. git-svn-id: file:///svn/unbound/trunk@2910 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 4 ++++ util/config_file.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 49a8d9e8a..8e45e825d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +13 Jun 2013: Wouter + - get_option, set_option, unbound-checkconf -o and libunbound + getoption and setoption support cache-min-ttl and cache-max-ttl. + 10 Jun 2013: Wouter - Fix#501: forward-first does not recurse, when forward name is ".". - iana portlist update. diff --git a/util/config_file.c b/util/config_file.c index 820034486..e251b13f3 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -360,7 +360,10 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_POW2("rrset-cache-slabs:", rrset_cache_slabs) else S_YNO("prefetch:", prefetch) else S_YNO("prefetch-key:", prefetch_key) - else S_NUMBER_OR_ZERO("cache-max-ttl:", max_ttl) + else if(strcmp(opt, "cache-max-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->max_ttl = atoi(val); MAX_TTL=cfg->max_ttl;} + else if(strcmp(opt, "cache-min-ttl:") == 0) + { IS_NUMBER_OR_ZERO; cfg->min_ttl = atoi(val); MIN_TTL=cfg->min_ttl;} else S_NUMBER_OR_ZERO("infra-host-ttl:", host_ttl) else S_POW2("infra-cache-slabs:", infra_cache_slabs) else S_SIZET_NONZERO("infra-cache-numhosts:", infra_cache_numhosts) @@ -596,6 +599,7 @@ config_get_option(struct config_file* cfg, const char* opt, else O_YNO(opt, "prefetch-key", prefetch_key) else O_YNO(opt, "prefetch", prefetch) else O_DEC(opt, "cache-max-ttl", max_ttl) + else O_DEC(opt, "cache-min-ttl", min_ttl) else O_DEC(opt, "infra-host-ttl", host_ttl) else O_DEC(opt, "infra-cache-slabs", infra_cache_slabs) else O_MEM(opt, "infra-cache-numhosts", infra_cache_numhosts)