* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resolver.c,v 1.327 2006/01/06 00:38:21 marka Exp $ */
+/* $Id: resolver.c,v 1.328 2006/01/06 01:05:46 marka Exp $ */
/*! \file */
* so, destroy the fctx.
*/
if (SHUTTINGDOWN(fctx) && !sentresponse) {
- maybe_destroy(fctx);
+ maybe_destroy(fctx); /* Locks bucket. */
goto cleanup_event;
}
+ LOCK(&fctx->res->buckets[fctx->bucketnum].lock);
+
/*
* If chaining, we need to make sure that the right result code is
* returned, and that the rdatasets are bound.
result = vevent->result;
add_bad(fctx, &addrinfo->sockaddr, result);
isc_event_free(&event);
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (sentresponse)
- fctx_done(fctx, result);
+ fctx_done(fctx, result); /* Locks bucket. */
else
- fctx_try(fctx);
+ fctx_try(fctx); /* Locks bucket. */
return;
}
* If we only deferred the destroy because we wanted to cache
* the data, destroy now.
*/
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (SHUTTINGDOWN(fctx))
- maybe_destroy(fctx);
-
+ maybe_destroy(fctx); /* Locks bucket. */
goto cleanup_event;
}
* more rdatasets that still need to
* be validated.
*/
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
goto cleanup_event;
}
if (node != NULL)
dns_db_detachnode(fctx->cache, &node);
- fctx_done(fctx, result);
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
+
+ fctx_done(fctx, result); /* Locks bucket. */
cleanup_event:
isc_event_free(&event);