nicer output from debug commands

git-svn-id: file:///svn/unbound/trunk@2314 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2010-10-27 08:09:22 +00:00
parent fdfa7b2793
commit 758a42643a
4 changed files with 14 additions and 2 deletions
+6 -1
View 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 */
+4
View 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;
+3 -1
View 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);
+1
View 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,