From fbde30645b88e4ea13963663d03cfb8c4271c454 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Thu, 27 Jul 2000 21:29:58 +0000 Subject: [PATCH] cd queries would cause the server to hang on exit. --- lib/dns/resolver.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 8d4682eb07..307402b764 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.157 2000/07/27 18:42:08 bwelling Exp $ */ +/* $Id: resolver.c,v 1.158 2000/07/27 21:29:58 bwelling Exp $ */ #include @@ -2618,7 +2618,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) { } else if (!ANSWER(rdataset)) continue; - if (ANSWER(rdataset)) { + if (ANSWER(rdataset) && need_validation) { if (fctx->type != dns_rdatatype_any && fctx->type != dns_rdatatype_sig) { /* @@ -2880,10 +2880,8 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) { if (secure_domain) { /* - * Do negative response validation. + * Mark all rdatasets as pending. */ - dns_validator_t *validator; - isc_task_t *task; dns_rdataset_t *trdataset; dns_name_t *tname; @@ -2904,8 +2902,15 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) { if (result != ISC_R_NOMORE) return (result); - validator = NULL; - task = res->buckets[fctx->bucketnum].task; + } + + if (need_validation) { + /* + * Do negative response validation. + */ + dns_validator_t *validator = NULL; + isc_task_t *task = res->buckets[fctx->bucketnum].task; + result = dns_validator_create(res->view, name, fctx->type, NULL, NULL, fctx->rmessage, 0, task, @@ -2919,8 +2924,7 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) { * to process the message, letting the validation complete * in its own good time. */ - if (need_validation) - return (ISC_R_SUCCESS); + return (ISC_R_SUCCESS); } LOCK(&res->buckets[fctx->bucketnum].lock);