mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +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:
@@ -444,6 +444,10 @@ static void subscription_invoke(struct stasis_subscription *sub,
|
||||
static void send_subscription_subscribe(struct stasis_topic *topic, struct stasis_subscription *sub);
|
||||
static void send_subscription_unsubscribe(struct stasis_topic *topic, struct stasis_subscription *sub);
|
||||
|
||||
void stasis_subscription_cb_noop(void *data, struct stasis_subscription *sub, struct stasis_message *message)
|
||||
{
|
||||
}
|
||||
|
||||
struct stasis_subscription *internal_stasis_subscribe(
|
||||
struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback,
|
||||
|
Reference in New Issue
Block a user