mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
Instead of setting a listener callback that is called by listener_destroy,
set the destroy_action callback used by omapi_object_dereference.
This commit is contained in:
@@ -34,8 +34,6 @@ typedef struct omapi_listener_object {
|
|||||||
isc_task_t *task;
|
isc_task_t *task;
|
||||||
isc_socket_t *socket; /* Listening socket. */
|
isc_socket_t *socket; /* Listening socket. */
|
||||||
dns_acl_t *acl;
|
dns_acl_t *acl;
|
||||||
void (*callback)(void *);
|
|
||||||
void *callback_arg;
|
|
||||||
/*
|
/*
|
||||||
* Locked by mutex.
|
* Locked by mutex.
|
||||||
*/
|
*/
|
||||||
@@ -273,8 +271,8 @@ free_task:
|
|||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
omapi_listener_listen(omapi_object_t *caller, isc_sockaddr_t *addr,
|
omapi_listener_listen(omapi_object_t *caller, isc_sockaddr_t *addr,
|
||||||
dns_acl_t *acl, int max, void (*callback)(void *),
|
dns_acl_t *acl, int max,
|
||||||
void *callback_arg)
|
isc_taskaction_t destroy_action, void *destroy_arg)
|
||||||
{
|
{
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
isc_task_t *task;
|
isc_task_t *task;
|
||||||
@@ -343,8 +341,8 @@ omapi_listener_listen(omapi_object_t *caller, isc_sockaddr_t *addr,
|
|||||||
* The callback is not set until here because it should
|
* The callback is not set until here because it should
|
||||||
* only be called if the listener was successfully set up.
|
* only be called if the listener was successfully set up.
|
||||||
*/
|
*/
|
||||||
listener->callback = callback;
|
listener->destroy_action = destroy_action;
|
||||||
listener->callback_arg = callback_arg;
|
listener->destroy_arg = destroy_arg;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -431,14 +429,6 @@ listener_destroy(omapi_object_t *listener) {
|
|||||||
|
|
||||||
if (l->acl != NULL)
|
if (l->acl != NULL)
|
||||||
dns_acl_detach(&l->acl);
|
dns_acl_detach(&l->acl);
|
||||||
|
|
||||||
/*
|
|
||||||
* XXDCL Technically, all the memory is not yet freed. Hmm.
|
|
||||||
* Somehow this callback stuff (or its "event" equivalent) needs to
|
|
||||||
* go into object_dereference.
|
|
||||||
*/
|
|
||||||
if (l->callback != NULL)
|
|
||||||
(*l->callback)(l->callback_arg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
|
Reference in New Issue
Block a user