From: Wouter Wijngaards Date: Tue, 21 Aug 2012 07:17:48 +0000 (+0000) Subject: - Fix timeouts so that when a server has been offline for a while X-Git-Tag: release-1.4.19rc1~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=940f6d98dee24837a60177627ee73c7a37da255b;p=thirdparty%2Funbound.git - Fix timeouts so that when a server has been offline for a while and is probed to see it works, it becomes fully available for server selection again. git-svn-id: file:///svn/unbound/trunk@2745 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index d7a624114..92016ea67 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,8 @@ +21 August 2012: Wouter + - Fix timeouts so that when a server has been offline for a while + and is probed to see it works, it becomes fully available for + server selection again. + 17 August 2012: Wouter - Add documentation to libunbound for default nonuse of resolv.conf. diff --git a/services/cache/infra.c b/services/cache/infra.c index dbbd50326..c674aca66 100644 --- a/services/cache/infra.c +++ b/services/cache/infra.c @@ -403,6 +403,11 @@ infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr, data->timeout_other++; } } else { + /* if we got a reply, but the old timeout was above server + * selection height, delete the timeout so the server is + * fully available again */ + if(rtt_unclamped(&data->rtt) >= USEFUL_SERVER_TOP_TIMEOUT) + rtt_init(&data->rtt); rtt_update(&data->rtt, roundtrip); data->probedelay = 0; if(qtype == LDNS_RR_TYPE_A)