]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
nicer output from debug commands
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Oct 2010 08:09:22 +0000 (08:09 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Oct 2010 08:09:22 +0000 (08:09 +0000)
git-svn-id: file:///svn/unbound/trunk@2314 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/cachedump.c
daemon/remote.c
services/cache/infra.c
services/cache/infra.h

index 85fe9f8396d2ba0ed46b70d1c7c9e5e1380f554e..242931a0950b21c4da83f706bb414771b6a7d540 100644 (file)
@@ -816,7 +816,12 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
                /* lookup in infra cache */
                entry_ttl = infra_get_host_rto(worker->env.infra_cache,
                        &a->addr, a->addrlen, &ri, &delay, *worker->env.now);
-               if(entry_ttl == -1) {
+               if(entry_ttl == -2 && ri.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
+                       if(!ssl_printf(ssl, "expired, rto %d msec.\n", ri.rto))
+                               return;
+                       continue;
+               }
+               if(entry_ttl == -1 || entry_ttl == -2) {
                        if(!ssl_printf(ssl, "not in infra cache.\n"))
                                return;
                        continue; /* skip stuff not in infra cache */
index f78e1d63272ddddde365debb6b9646432110501e..fb79722ef8f3d261705a8474487aa0c06834ae9d 100644 (file)
@@ -1567,6 +1567,10 @@ dump_infra_host(struct lruhash_entry* e, void* arg)
        a->ipstr = ip_str;
        /* skip expired stuff (only backed off) */
        if(d->ttl < a->now) {
+               if(d->rtt.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
+                       if(!ssl_printf(a->ssl, "%s expired rto %d\n", ip_str,
+                               d->rtt.rto)) return;
+               }
                if(d->lameness)
                        lruhash_traverse(d->lameness, 0, &dump_infra_lame, arg);
                return;
index d6b542308e1a89f42a53dec91aa2a9fd5f105eb1..ba02b5083d8bf99eee41585f0e5a2c5b68ea67c6 100644 (file)
@@ -542,7 +542,7 @@ int infra_get_host_rto(struct infra_cache* infra,
        struct lruhash_entry* e = infra_lookup_host_nottl(infra, addr, 
                addrlen, 0);
        struct infra_host_data* data;
-       int ttl = -1;
+       int ttl = -2;
        if(!e) return -1;
        data = (struct infra_host_data*)e->data;
        if(data->ttl >= timenow) {
@@ -640,6 +640,8 @@ infra_get_lame_rtt(struct infra_cache* infra,
        if(timenow > host->ttl) {
                /* expired entry */
                /* see if this can be a re-probe of an unresponsive server */
+               /* minus 1000 because that is outside of the RTTBAND, so
+                * blacklisted servers stay blacklisted if this is chosen */
                if(host->rtt.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
                        *rtt = USEFUL_SERVER_TOP_TIMEOUT-1000;
                        lock_rw_unlock(&e->lock);
index 376e1ae5012d3cb72c05e04662d8acd2252cd5be..3d7f986f2cd36638da642e4027f31f7d69880ecc 100644 (file)
@@ -299,6 +299,7 @@ int infra_get_lame_rtt(struct infra_cache* infra,
  * @param delay: probe delay (if any).
  * @param timenow: what time it is now.
  * @return TTL the infra host element is valid for. If -1: not found in cache.
+ *     TTL -2: found but expired.
  */
 int infra_get_host_rto(struct infra_cache* infra,
         struct sockaddr_storage* addr, socklen_t addrlen,