]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Jostle time used to estimate roundtrip.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 20 Oct 2010 08:19:05 +0000 (08:19 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 20 Oct 2010 08:19:05 +0000 (08:19 +0000)
git-svn-id: file:///svn/unbound/trunk@2301 be551aaa-1e26-0410-a405-d3ace91eadb9

services/cache/infra.c
services/cache/infra.h

index a43c22b0b29fea5057e3b09f8b49e3baaf21356c..99e48087a90dbfd7d495e1b2aaff885799cd06d8 100644 (file)
@@ -102,6 +102,7 @@ infra_create(struct config_file* cfg)
        infra->host_ttl = cfg->host_ttl;
        infra->lame_ttl = cfg->lame_ttl;
        infra->max_lame_size = cfg->infra_cache_lame_size;
+       infra->jostle = cfg->jostle_time;
        return infra;
 }
 
@@ -123,6 +124,7 @@ infra_adjust(struct infra_cache* infra, struct config_file* cfg)
        infra->host_ttl = cfg->host_ttl;
        infra->lame_ttl = cfg->lame_ttl;
        infra->max_lame_size = cfg->infra_cache_lame_size;
+       infra->jostle = cfg->jostle_time;
        maxmem = cfg->infra_cache_numhosts * 
                (sizeof(struct infra_host_key)+sizeof(struct infra_host_data));
        if(maxmem != slabhash_get_size(infra->hosts) ||
@@ -274,8 +276,8 @@ infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
                 * The server seems to still reply but sporadically.
                 * Perhaps it has rate-limited the traffic, or it
                 * drops particular queries (AAAA).  ignore timeouts,
-                * but we use an expanded variance of 6x. */
-               *to = data->rtt.srtt + 6*data->rtt.rttvar;
+                * and use the jostle timeout for rtt estimate. */
+               *to = infra->jostle;
        *edns_vs = data->edns_version;
        *edns_lame_known = data->edns_lame_known;
        lock_rw_unlock(&e->lock);
index 80321b0e11e693d034167969d099c6b43baa2b81..e70ed968fb0964e3163eb0ce8219698a7f32a33d 100644 (file)
@@ -120,6 +120,8 @@ struct infra_cache {
        int lame_ttl;
        /** infra lame cache max memory per host, in bytes */
        size_t max_lame_size;
+       /** jostle timeout in msec */
+       size_t jostle;
 };
 
 /** infra host cache default hash lookup size */