mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Stasis: Fix unsafe use of stasis_unsubscribe in modules.
Many uses of stasis_unsubscribe in modules can be reached through unload. These have been switched to stasis_unsubscribe_and_join. Some subscription callbacks do nothing, for these I've created a noop callback function in stasis.c. This is used by some modules that monitor MWI topics in order to enable cache, since the callback does not become invalid after dlclose it is safe to use stasis_unsubscribe on these, even during module unload. ASTERISK-25121 #close Change-Id: Ifc2549fbd8eef7d703c222978e8f452e2972189c
This commit is contained in:
@@ -510,6 +510,17 @@ void stasis_publish_sync(struct stasis_subscription *sub, struct stasis_message
|
||||
*/
|
||||
typedef void (*stasis_subscription_cb)(void *data, struct stasis_subscription *sub, struct stasis_message *message);
|
||||
|
||||
/*!
|
||||
* \brief Stasis subscription callback function that does nothing.
|
||||
*
|
||||
* \note This callback should be used for events are not directly processed, but need
|
||||
* to be generated so data can be retrieved from cache later. Subscriptions with this
|
||||
* callback can be released with \ref stasis_unsubscribe, even during module unload.
|
||||
*
|
||||
* \since 13.5
|
||||
*/
|
||||
void stasis_subscription_cb_noop(void *data, struct stasis_subscription *sub, struct stasis_message *message);
|
||||
|
||||
/*!
|
||||
* \brief Create a subscription.
|
||||
*
|
||||
|
Reference in New Issue
Block a user