From b599cfd7931c078ea3c1c1d03890daabebc12450 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 11 Feb 2000 19:58:11 +0000 Subject: [PATCH] RTT penalization was not happening for the nonresponding servers in the very common case where some server responded with the answer. This would prevent avoidance of the nonresponding servers, significantly increasing latency. --- lib/dns/resolver.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index d18cad2cf0..4723932d31 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -420,9 +420,9 @@ fctx_cleanupforwaddrs(fetchctx_t *fctx) { } static inline void -fctx_stopeverything(fetchctx_t *fctx) { +fctx_stopeverything(fetchctx_t *fctx, isc_boolean_t no_response) { FCTXTRACE("stopeverything"); - fctx_cancelqueries(fctx, ISC_FALSE); + fctx_cancelqueries(fctx, no_response); fctx_cleanupfinds(fctx); fctx_cleanupforwaddrs(fctx); fctx_stoptimer(fctx); @@ -456,12 +456,17 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) { static void fctx_done(fetchctx_t *fctx, isc_result_t result) { dns_resolver_t *res; + isc_boolean_t no_response; FCTXTRACE("done"); res = fctx->res; - fctx_stopeverything(fctx); + if (result == ISC_R_SUCCESS) + no_response = ISC_TRUE; + else + no_response = ISC_FALSE; + fctx_stopeverything(fctx, no_response); LOCK(&res->buckets[fctx->bucketnum].lock); @@ -1604,7 +1609,7 @@ fctx_doshutdown(isc_task_t *task, isc_event_t *event) { INSIST(fctx->want_shutdown); if (fctx->state != fetchstate_done) { - fctx_stopeverything(fctx); + fctx_stopeverything(fctx, ISC_FALSE); fctx->state = fetchstate_done; fctx_sendevents(fctx, ISC_R_CANCELED); }