[Asterisk-code-review] res pjsip pubsub: Move where the subscription is stored to a... (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Mon Feb 15 15:18:56 CST 2016
Joshua Colp has submitted this change and it was merged.
Change subject: res_pjsip_pubsub: Move where the subscription is stored to after initialized.
......................................................................
res_pjsip_pubsub: Move where the subscription is stored to after initialized.
A problem arose when testing the AMI subscription listing actions where it
was possible for a subscription that had not been fully initialized to be
listed. This was problematic as the underlying listing code would crash.
This change makes it so the subscription tree is fully set up before it is
added to the list of subscriptions. This ensures that when the listing actions
get the subscription it is valid.
ASTERISK-25738 #close
Change-Id: Iace2b13641c31bbcc0d43a39f99aba1f340c0f48
---
M res/res_pjsip_pubsub.c
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Mark Michelson: Looks good to me, approved
Joshua Colp: Verified
George Joseph: Looks good to me, but someone else must approve
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index dc7f5ed..bde7075 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1254,7 +1254,6 @@
sub_tree->endpoint = ao2_bump(endpoint);
sub_tree->notify_sched_id = -1;
- add_subscription(sub_tree);
return sub_tree;
}
@@ -1327,6 +1326,8 @@
if (AST_VECTOR_SIZE(&sub_tree->root->children) > 0) {
sub_tree->is_list = 1;
}
+
+ add_subscription(sub_tree);
return sub_tree;
}
@@ -1616,6 +1617,8 @@
return NULL;
}
+ add_subscription(sub_tree);
+
return sub;
}
--
To view, visit https://gerrit.asterisk.org/2248
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iace2b13641c31bbcc0d43a39f99aba1f340c0f48
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-code-review
mailing list