- delete of mesh does a postorder traverse of the tree.
- found and fixed a memory leak. For TTL=0 messages, that would
not be cached, instead the msg-replyinfo structure was leaked.
+ - changed server selection so it will filter out hosts that are
+ unresponsive. This is defined as a host with the maximum rto value.
+ This means that unbound tried the host for retries up to 120 secs.
+ The rto value will time out after host-ttl seconds from the cache.
+ This keeps such unresolvable queries from taking up resources.
26 June 2007: Wouter
- mesh is called by worker, and iterator uses it.
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
name, namelen, &lame, &rtt, now)) {
if(lame)
- return -1;
- else return rtt;
+ return -1; /* server is lame */
+ else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT)
+ return -1; /* server is unresponsive */
+ else return rtt;
}
/* no server information present */
return UNKNOWN_SERVER_NICENESS;
#define MAX_RESTART_COUNT 8
/** max number of referrals. Makes sure resolver does not run away */
#define MAX_REFERRAL_COUNT 30
-/** how nice is a server without further information, in msec */
+/** how nice is a server without further information, in msec
+ * Equals rtt initial timeout value.
+ */
#define UNKNOWN_SERVER_NICENESS 3000
+/** maximum timeout before a host is deemed unsuitable, in msec.
+ * After host_ttl this will be timed out and the host will be tried again.
+ * Equals RTT_MAX_TIMEOUT
+ */
+#define USEFUL_SERVER_TOP_TIMEOUT 120000
/**
* Global state for the iterator.