]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix for top reuse
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 26 Oct 2010 15:28:01 +0000 (15:28 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 26 Oct 2010 15:28:01 +0000 (15:28 +0000)
git-svn-id: file:///svn/unbound/trunk@2312 be551aaa-1e26-0410-a405-d3ace91eadb9

services/cache/infra.c

index 9e1e3a81c519e7bb598c46a38e2017ec5c6fc5e7..daa97a1d1c77134f9cb5e54588fc3b4685587fcf 100644 (file)
@@ -264,6 +264,7 @@ infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
        int wr = 0;
        if(e && ((struct infra_host_data*)e->data)->ttl < timenow) {
                /* it expired, try to reuse existing entry */
+               int old = ((struct infra_host_data*)e->data)->rtt.rto;
                lock_rw_unlock(&e->lock);
                e = infra_lookup_host_nottl(infra, addr, addrlen, 1);
                if(e) {
@@ -272,6 +273,9 @@ infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
                        /* do not touch lameness, it may be valid still */
                        host_entry_init(infra, e, timenow);
                        wr = 1;
+                       /* TOP_TIMEOUT remains on reuse */
+                       if(old >= USEFUL_SERVER_TOP_TIMEOUT)
+                               ((struct infra_host_data*)e->data)->rtt.rto=old;
                }
        }
        if(!e) {