]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- get_option, set_option, unbound-checkconf -o and libunbound
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 13 Jun 2013 08:26:41 +0000 (08:26 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 13 Jun 2013 08:26:41 +0000 (08:26 +0000)
  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
util/config_file.c

index 49a8d9e8a40b5e04eda3e10b1c400b8ba7f8bf97..8e45e825d50c4b64cf6a13d533011a70fd7c9fe2 100644 (file)
@@ -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.
index 820034486c69e1825d3512a55fbae4bc69f93162..e251b13f3fa68bba2e5edfb98f68df490d13dba4 100644 (file)
@@ -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)