[Asterisk-code-review] res_pjsip_refer: Refactor progress locking and serialization (asterisk[16])

George Joseph asteriskteam at digium.com
Wed Feb 24 12:03:49 CST 2021


George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15494 )

Change subject: res_pjsip_refer: Refactor progress locking and serialization
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.asterisk.org/c/asterisk/+/15494/3/res/res_pjsip_refer.c 
File res/res_pjsip_refer.c:

https://gerrit.asterisk.org/c/asterisk/+/15494/3/res/res_pjsip_refer.c@346 
PS3, Line 346: 	progress->sub = NULL;
             : 
             : 		ast_debug(3, "Subscription '%p' removed from progress monitor '%p'\n", sub, progress);
             : 
             : 		if (pjsip_evsub_get_mod_data(sub, refer_progress_module.id)) {
             : 			pjsip_evsub_set_mod_data(sub, refer_progress_module.id, NULL);
             : 			ao2_cleanup(progress);
             : 		}
> My previous comment about no longer needing to test if the pjsip_evsub_get_mod_data() is still valid.  There is no need to test, just do because we are holding the dialog lock just like in refer_progress_notify().
> 
> It appears that the indicated code could be put into a helper routine that is called by refere_progress_notify() too.
> 
> helper_routine(progress)
> {
>   progress->sub = NULL
>   pjsip_evsub_set_mod_data(progress->sub, refer_progress_module.id, NULL)
> 
>   /* Remove the ref held by the evsub mod data pointer */
>   ao2_cleanup(progress)
> }

Well, actually, pjproject always calls refer_progress_on_evsub_state() when the subscription actually terminates so i'm not sure why we were also doing it in res_progress_notify().



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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I97a8bb01771a3c85345649b8124507f7622a8480
Gerrit-Change-Number: 15494
Gerrit-PatchSet: 3
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Wed, 24 Feb 2021 18:03:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Richard Mudgett <rmudgett at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210224/aafb0fb2/attachment.html>


More information about the asterisk-code-review mailing list