2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

make the validator attach to the view only weakly, so that

the view can start shutting down even though a validation is in progress.
This commit is contained in:
Andreas Gustafsson 2000-08-14 22:17:40 +00:00
parent 1e2749dba8
commit ef97e09e20

View File

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: validator.c,v 1.71 2000/08/01 01:23:04 tale Exp $ */ /* $Id: validator.c,v 1.72 2000/08/14 22:17:40 gson Exp $ */
#include <config.h> #include <config.h>
@ -1369,7 +1369,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
if (val == NULL) if (val == NULL)
return (ISC_R_NOMEMORY); return (ISC_R_NOMEMORY);
val->view = NULL; val->view = NULL;
dns_view_attach(view, &val->view); dns_view_weakattach(view, &val->view);
event = (dns_validatorevent_t *) event = (dns_validatorevent_t *)
isc_event_allocate(view->mctx, task, isc_event_allocate(view->mctx, task,
DNS_EVENT_VALIDATORSTART, DNS_EVENT_VALIDATORSTART,
@ -1421,7 +1421,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
isc_event_free((isc_event_t **)&val->event); isc_event_free((isc_event_t **)&val->event);
cleanup_val: cleanup_val:
dns_view_detach(&val->view); dns_view_weakdetach(&val->view);
isc_mem_put(view->mctx, val, sizeof *val); isc_mem_put(view->mctx, val, sizeof *val);
return (result); return (result);
@ -1474,7 +1474,7 @@ destroy(dns_validator_t *val) {
if (val->siginfo != NULL) if (val->siginfo != NULL)
isc_mem_put(mctx, val->siginfo, sizeof *val->siginfo); isc_mem_put(mctx, val->siginfo, sizeof *val->siginfo);
isc_mutex_destroy(&val->lock); isc_mutex_destroy(&val->lock);
dns_view_detach(&val->view); dns_view_weakdetach(&val->view);
val->magic = 0; val->magic = 0;
isc_mem_put(mctx, val, sizeof *val); isc_mem_put(mctx, val, sizeof *val);
} }