+10 Sep 2013: Wouter
+ - MIN_TTL and MAX_TTL also in time_t.
+
26 Aug 2013: Wouter
- More fixes for bug#519: for the threaded case test if the bg
thread has been killed, on ub_ctx_delete, to avoid hangs.
else S_YNO("prefetch:", prefetch)
else S_YNO("prefetch-key:", prefetch_key)
else if(strcmp(opt, "cache-max-ttl:") == 0)
- { IS_NUMBER_OR_ZERO; cfg->max_ttl = atoi(val); MAX_TTL=(uint32_t)cfg->max_ttl;}
+ { IS_NUMBER_OR_ZERO; cfg->max_ttl = atoi(val); MAX_TTL=(time_t)cfg->max_ttl;}
else if(strcmp(opt, "cache-min-ttl:") == 0)
- { IS_NUMBER_OR_ZERO; cfg->min_ttl = atoi(val); MIN_TTL=(uint32_t)cfg->min_ttl;}
+ { IS_NUMBER_OR_ZERO; cfg->min_ttl = atoi(val); MIN_TTL=(time_t)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)
void
config_apply(struct config_file* config)
{
- MAX_TTL = (uint32_t)config->max_ttl;
- MIN_TTL = (uint32_t)config->min_ttl;
+ MAX_TTL = (time_t)config->max_ttl;
+ MIN_TTL = (time_t)config->min_ttl;
EDNS_ADVERTISED_SIZE = (uint16_t)config->edns_buffer_size;
MINIMAL_RESPONSES = config->minimal_responses;
RRSET_ROUNDROBIN = config->rrset_roundrobin;
/** number of buckets in parse rrset hash table. Must be power of 2. */
#define PARSE_TABLE_SIZE 32
/** Maximum TTL that is allowed. */
-extern uint32_t MAX_TTL;
+extern time_t MAX_TTL;
/** Minimum TTL that is allowed. */
-extern uint32_t MIN_TTL;
+extern time_t MIN_TTL;
/** Negative cache time (for entries without any RRs.) */
#define NORR_TTL 5 /* seconds */
#include "util/data/msgencode.h"
/** MAX TTL default for messages and rrsets */
-uint32_t MAX_TTL = 3600 * 24 * 10; /* ten days */
+time_t MAX_TTL = 3600 * 24 * 10; /* ten days */
/** MIN TTL default for messages and rrsets */
-uint32_t MIN_TTL = 0;
+time_t MIN_TTL = 0;
/** allocate qinfo, return 0 on error */
static int