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:
Corey Farrell
2015-05-22 22:50:43 -04:00
parent f66c41e668
commit 50044fdc15
13 changed files with 38 additions and 35 deletions

View File

@@ -3568,12 +3568,12 @@ int ast_xmpp_client_disconnect(struct ast_xmpp_client *client)
}
if (client->mwi_sub) {
client->mwi_sub = stasis_unsubscribe(client->mwi_sub);
client->mwi_sub = stasis_unsubscribe_and_join(client->mwi_sub);
xmpp_pubsub_unsubscribe(client, "message_waiting");
}
if (client->device_state_sub) {
client->device_state_sub = stasis_unsubscribe(client->device_state_sub);
client->device_state_sub = stasis_unsubscribe_and_join(client->device_state_sub);
xmpp_pubsub_unsubscribe(client, "device_state");
}