[Asterisk-code-review] res_pjsip_pubsub: delete scheduled notification on RLS update (asterisk[18])

Alexei Gradinari asteriskteam at digium.com
Tue Jun 7 18:02:24 CDT 2022


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18642 )


Change subject: res_pjsip_pubsub: delete scheduled notification on RLS update
......................................................................

res_pjsip_pubsub: delete scheduled notification on RLS update

If there is scheduled notification, we must delete it
to avoid using destroyed subscriptions.

ASTERISK-29906

Change-Id: I1c644e5e15a8fe43eed8e4f9112f113cbf87a40f
---
M res/res_pjsip_pubsub.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/18642/1

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 5cccdcc..13968d3 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -4059,6 +4059,12 @@
 						new_root->version = old_root->version;
 						sub_tree->root = new_root;
 						sub_tree->generate_initial_notify = 1;
+
+						/* If there is scheduled notification need to delete it to avoid use old subscriptions */
+						if (sub_tree->notify_sched_id > -1) {
+							AST_SCHED_DEL_UNREF(sched, sub_tree->notify_sched_id, ao2_ref(sub_tree, -1));
+							sub_tree->send_scheduled_notify = 0;
+						}
 						shutdown_subscriptions(old_root);
 						destroy_subscriptions(old_root);
 					} else {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18642
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I1c644e5e15a8fe43eed8e4f9112f113cbf87a40f
Gerrit-Change-Number: 18642
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220607/b2f141d7/attachment.html>


More information about the asterisk-code-review mailing list