}
if (zone->db_registered) {
- INSIST(dns_db_updatenotify_unregister(
- zone->db, dns_catz_dbupdate_callback,
- zone->catzs) == ISC_R_SUCCESS);
+ dns_db_updatenotify_unregister(
+ zone->db, dns_catz_dbupdate_callback, zone->catzs);
}
if (zone->dbversion) {
dns_db_closeversion(zone->db, &zone->dbversion, false);
return ((db->methods->rpz_ready)(db));
}
-/**
+/*
* Attach a notify-on-update function the database
*/
isc_result_t
REQUIRE(db != NULL);
REQUIRE(fn != NULL);
+ for (listener = ISC_LIST_HEAD(db->update_listeners); listener != NULL;
+ listener = ISC_LIST_NEXT(listener, link))
+ {
+ if ((listener->onupdate == fn) &&
+ (listener->onupdate_arg == fn_arg))
+ {
+ return (ISC_R_SUCCESS);
+ }
+ }
+
listener = isc_mem_get(db->mctx, sizeof(dns_dbonupdatelistener_t));
listener->onupdate = fn;
void *fn_arg);
/*%<
* Register a notify-on-update callback function to a database.
+ * Duplicate callbacks are suppressed.
*
* Requires:
*
* \li 'db' is a valid database
- * \li 'db' does not have an update callback registered
* \li 'fn' is not NULL
*
*/