msg_result = dns_message_reply(client->message, true);
if (msg_result != ISC_R_SUCCESS) {
- goto msg_failure;
+ isc_log_write(ns_lctx, NS_LOGCATEGORY_UPDATE,
+ NS_LOGMODULE_UPDATE, ISC_LOG_ERROR,
+ "could not create update response message: %s",
+ isc_result_totext(msg_result));
+ ns_client_drop(client, msg_result);
+ isc_nmhandle_detach(&client->reqhandle);
+ return;
}
- client->message->rcode = dns_result_torcode(result);
+ client->message->rcode = dns_result_torcode(result);
ns_client_send(client);
- return;
-
-msg_failure:
- isc_log_write(ns_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE,
- ISC_LOG_ERROR,
- "could not create update response message: %s",
- isc_result_totext(msg_result));
- ns_client_drop(client, msg_result);
isc_nmhandle_detach(&client->reqhandle);
}
dns_zone_t *zone = NULL, *raw = NULL;
/*
- * Attach to the request handle
+ * Attach to the request handle. This will be held until
+ * we respond, or drop the request.
*/
isc_nmhandle_attach(handle, &client->reqhandle);
default:
FAILC(DNS_R_NOTAUTH, "not authoritative for update zone");
}
-
- isc_nmhandle_detach(&client->reqhandle);
return;
failure:
if (zone != NULL) {
dns_zone_detach(&zone);
}
- isc_nmhandle_detach(&client->reqhandle);
}
/*%
ns_client_sendraw(client, uev->answer);
dns_message_detach(&uev->answer);
isc_event_free(&event);
+ isc_nmhandle_detach(&client->reqhandle);
isc_nmhandle_detach(&client->updatehandle);
}