mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
res_ari_events: Fix shutdown ref leak.
ASTERISK-25308 #close Reported by: Joshua Colp Change-Id: I592785bf70ff4b63d00e535b482f40da8e82a082
This commit is contained in:
@@ -426,13 +426,18 @@ static int event_session_alloc(struct ast_tcptls_session_instance *ser,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ast_ari_websocket_events_event_websocket_dtor(void)
|
||||||
|
{
|
||||||
|
ao2_cleanup(event_session_registry);
|
||||||
|
event_session_registry = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int ast_ari_websocket_events_event_websocket_init(void)
|
int ast_ari_websocket_events_event_websocket_init(void)
|
||||||
{
|
{
|
||||||
/* Try to instantiate the registry */
|
/* Try to instantiate the registry */
|
||||||
event_session_registry = ao2_container_alloc(EVENT_SESSION_NUM_BUCKETS,
|
event_session_registry = ao2_container_alloc(EVENT_SESSION_NUM_BUCKETS,
|
||||||
event_session_hash,
|
event_session_hash,
|
||||||
event_session_compare);
|
event_session_compare);
|
||||||
|
|
||||||
if (!event_session_registry) {
|
if (!event_session_registry) {
|
||||||
/* This is bad, bad. */
|
/* This is bad, bad. */
|
||||||
ast_log(LOG_WARNING,
|
ast_log(LOG_WARNING,
|
||||||
|
@@ -57,6 +57,13 @@ struct ast_ari_events_event_websocket_args {
|
|||||||
*/
|
*/
|
||||||
int ast_ari_websocket_events_event_websocket_init(void);
|
int ast_ari_websocket_events_event_websocket_init(void);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief WebSocket connection for events.
|
||||||
|
*
|
||||||
|
* \return Nothing
|
||||||
|
*/
|
||||||
|
void ast_ari_websocket_events_event_websocket_dtor(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief WebSocket connection for events.
|
* \brief WebSocket connection for events.
|
||||||
*
|
*
|
||||||
|
@@ -462,6 +462,7 @@ static int unload_module(void)
|
|||||||
ast_ari_remove_handler(&events);
|
ast_ari_remove_handler(&events);
|
||||||
ao2_cleanup(events.ws_server);
|
ao2_cleanup(events.ws_server);
|
||||||
events.ws_server = NULL;
|
events.ws_server = NULL;
|
||||||
|
ast_ari_websocket_events_event_websocket_dtor();
|
||||||
stasis_app_unref();
|
stasis_app_unref();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -102,6 +102,17 @@ void ast_ari_{{c_name}}_{{c_nickname}}(struct ast_variable *headers, struct ast_
|
|||||||
*/
|
*/
|
||||||
int ast_ari_websocket_{{c_name}}_{{c_nickname}}_init(void);
|
int ast_ari_websocket_{{c_name}}_{{c_nickname}}_init(void);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief {{summary}}
|
||||||
|
{{#notes}}
|
||||||
|
*
|
||||||
|
* {{{notes}}}
|
||||||
|
{{/notes}}
|
||||||
|
*
|
||||||
|
* \return Nothing
|
||||||
|
*/
|
||||||
|
void ast_ari_websocket_{{c_name}}_{{c_nickname}}_dtor(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief {{summary}}
|
* \brief {{summary}}
|
||||||
{{#notes}}
|
{{#notes}}
|
||||||
|
Reference in New Issue
Block a user