}
static void
-runintask(isc_task_t *task, isc_event_t *event) {
+startupdate(isc_task_t *task, isc_event_t *event) {
updatectx_t *uctx;
isc_result_t result;
unsigned int resoptions;
dns_section_t section = DNS_SECTION_UPDATE;
isc_sockaddr_t *server, *sa = NULL;
dns_tsectype_t tsectype = dns_tsectype_none;
- isc_event_t *runinevent;
UNUSED(options);
return (ISC_R_NOMEMORY);
}
- runinevent = isc_event_allocate(client->mctx, client->task,
- DNS_EVENT_RUNIN, runintask,
- uctx, sizeof(*runinevent));
- if (runinevent == NULL) {
- dns_view_detach(&view);
- isc_mem_put(client->mctx, uctx, sizeof(*uctx));
- return (ISC_R_NOMEMORY);
- }
-
result = isc_mutex_init(&uctx->lock);
if (result != ISC_R_SUCCESS) {
dns_view_detach(&view);
- isc_event_free(&runinevent);
isc_mem_put(client->mctx, uctx, sizeof(*uctx));
return (ISC_R_NOMEMORY);
}
UNLOCK(&client->lock);
*transp = (dns_clientupdatetrans_t *)uctx;
- isc_task_send(client->task, &runinevent);
-
- return (ISC_R_SUCCESS);
+ result = isc_app_ctxonrun(client->actx, client->mctx, client->task,
+ startupdate, uctx);
+ if (result == ISC_R_SUCCESS)
+ return (result);
+ *transp = NULL;
fail:
- if (runinevent != NULL)
- isc_event_free(&runinevent);
if (ISC_LINK_LINKED(uctx, link)) {
LOCK(&client->lock);
ISC_LIST_UNLINK(client->updatectxs, uctx, link);
#define DNS_EVENT_KEYDONE (ISC_EVENTCLASS_DNS + 50)
#define DNS_EVENT_SETNSEC3PARAM (ISC_EVENTCLASS_DNS + 51)
#define DNS_EVENT_SETSERIAL (ISC_EVENTCLASS_DNS + 52)
-#define DNS_EVENT_CATZUPDATED (ISC_EVENTCLASS_DNS + 53)
-#define DNS_EVENT_CATZADDZONE (ISC_EVENTCLASS_DNS + 54)
-#define DNS_EVENT_CATZMODZONE (ISC_EVENTCLASS_DNS + 55)
-#define DNS_EVENT_CATZDELZONE (ISC_EVENTCLASS_DNS + 56)
-#define DNS_EVENT_RUNIN (ISC_EVENTCLASS_DNS + 57)
#define DNS_EVENT_FIRSTEVENT (ISC_EVENTCLASS_DNS + 0)
#define DNS_EVENT_LASTEVENT (ISC_EVENTCLASS_DNS + 65535)