]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
debug infra lines for infa timeout counters.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 Feb 2012 14:48:09 +0000 (14:48 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 Feb 2012 14:48:09 +0000 (14:48 +0000)
git-svn-id: file:///svn/unbound/trunk@2616 be551aaa-1e26-0410-a405-d3ace91eadb9

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

index e5be8564e10d3de56009ccd6b1a5f7ab6d5523b3..b6a4de8c5c66037c47fefbe20e63e8e72f019c69 100644 (file)
@@ -802,7 +802,8 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
 {
        char buf[257];
        struct delegpt_addr* a;
-       int lame, dlame, rlame, rto, edns_vs, to, delay, entry_ttl;
+       int lame, dlame, rlame, rto, edns_vs, to, delay, entry_ttl,
+               tA, tAAAA, tother;
        struct rtt_info ri;
        uint8_t edns_lame_known;
        for(a = dp->target_list; a; a = a->next_target) {
@@ -817,9 +818,11 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
                delay=0;
                entry_ttl = infra_get_host_rto(worker->env.infra_cache,
                        &a->addr, a->addrlen, dp->name, dp->namelen,
-                       &ri, &delay, *worker->env.now);
+                       &ri, &delay, *worker->env.now, &tA, &tAAAA, &tother);
                if(entry_ttl == -2 && ri.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
-                       if(!ssl_printf(ssl, "expired, rto %d msec.\n", ri.rto))
+                       if(!ssl_printf(ssl, "expired, rto %d msec, tA %d "
+                               "tAAAA %d tother %d.\n", ri.rto, tA, tAAAA,
+                               tother))
                                return;
                        continue;
                }
@@ -840,11 +843,12 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
                        continue; /* skip stuff not in infra cache */
                }
                if(!ssl_printf(ssl, "%s%s%s%srto %d msec, ttl %d, ping %d "
-                       "var %d rtt %d",
+                       "var %d rtt %d, tA %d, tAAAA %d, tother %d",
                        lame?"LAME ":"", dlame?"NoDNSSEC ":"",
                        a->lame?"AddrWasParentSide ":"",
                        rlame?"NoAuthButRecursive ":"", rto, entry_ttl,
-                       ri.srtt, ri.rttvar, rtt_notimeout(&ri)))
+                       ri.srtt, ri.rttvar, rtt_notimeout(&ri),
+                       tA, tAAAA, tother))
                        return;
                if(delay)
                        if(!ssl_printf(ssl, ", probedelay %d", delay))
index a2b2204c240361469aa9161b5d82f961343215b5..15847daf4bdd45460c17631ac4e418d5bf9251fc 100644 (file)
@@ -1570,9 +1570,11 @@ dump_infra_host(struct lruhash_entry* e, void* arg)
                return;
        }
        if(!ssl_printf(a->ssl, "%s %s ttl %d ping %d var %d rtt %d rto %d "
+               "tA %d tAAAA %d tother %d "
                "ednsknown %d edns %d delay %d lame dnssec %d rec %d A %d "
                "other %d\n", ip_str, name, (int)(d->ttl - a->now),
                d->rtt.srtt, d->rtt.rttvar, rtt_notimeout(&d->rtt), d->rtt.rto,
+               d->timeout_A, d->timeout_AAAA, d->timeout_other,
                (int)d->edns_lame_known, (int)d->edns_version,
                (int)(a->now<d->probedelay?d->probedelay-a->now:0),
                (int)d->isdnsseclame, (int)d->rec_lame, (int)d->lame_type_A,
index 9baedd13f846b045a4b4fe8ca1f61e5c261b6e9a..06c5e947bc4be61da4601eaf072c7ca70a52f78d 100644 (file)
@@ -422,7 +422,8 @@ infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr,
 
 int infra_get_host_rto(struct infra_cache* infra,
         struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* nm,
-       size_t nmlen, struct rtt_info* rtt, int* delay, uint32_t timenow)
+       size_t nmlen, struct rtt_info* rtt, int* delay, uint32_t timenow,
+       int* tA, int* tAAAA, int* tother)
 {
        struct lruhash_entry* e = infra_lookup_nottl(infra, addr, addrlen,
                nm, nmlen, 0);
@@ -437,6 +438,9 @@ int infra_get_host_rto(struct infra_cache* infra,
                        *delay = (int)(data->probedelay - timenow);
                else    *delay = 0;
        }
+       *tA = data->timeout_A;
+       *tAAAA = data->timeout_AAAA;
+       *tother = data->timeout_other;
        lock_rw_unlock(&e->lock);
        return ttl;
 }
index 5d15b5eee956b1ed0254ae1d539bf4bec16762ad..161f5ab4319e923dfc76427f802d67b4024b6e58 100644 (file)
@@ -275,12 +275,16 @@ int infra_get_lame_rtt(struct infra_cache* infra,
  * @param rtt: the rtt_info is copied into here (caller alloced return struct).
  * @param delay: probe delay (if any).
  * @param timenow: what time it is now.
+ * @param tA: timeout counter on type A.
+ * @param tAAAA: timeout counter on type AAAA.
+ * @param tother: timeout counter on type other.
  * @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, uint8_t* name,
-       size_t namelen, struct rtt_info* rtt, int* delay, uint32_t timenow);
+       size_t namelen, struct rtt_info* rtt, int* delay, uint32_t timenow,
+       int* tA, int* tAAAA, int* tother);
 
 /**
  * Get memory used by the infra cache.