<p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15494">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15494/3/res/res_pjsip_refer.c">File res/res_pjsip_refer.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15494/3/res/res_pjsip_refer.c@164">Patch Set #3, Line 164:</a> <code style="font-family:monospace,monospace">               /* This is for dropping the reference on the subscription */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I had initially commented about moving this comment to where the ao2_cleanup was moved.  I removed it in favor of the other comment I did put about locking.  So I am resurrecting the initial comment.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Though, I'm not seeing a need to move the ao2_cleanup anyway.  We are getting rid of the ref that is held by the pjsip_evsub_set_mod_data() pointer.  Does this routine not have its own ref to progress in the notification object?</p><p style="white-space: pre-wrap; word-wrap: break-word;">Could call the helper_routine() function described in the other comment here.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15494/3/res/res_pjsip_refer.c@346">Patch Set #3, Line 346:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">        progress->sub = NULL;<br><br>            ast_debug(3, "Subscription '%p' removed from progress monitor '%p'\n", sub, progress);<br><br>            if (pjsip_evsub_get_mod_data(sub, refer_progress_module.id)) {<br>                        pjsip_evsub_set_mod_data(sub, refer_progress_module.id, NULL);<br>                        ao2_cleanup(progress);<br>                }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">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().</p><p style="white-space: pre-wrap; word-wrap: break-word;">It appears that the indicated code could be put into a helper routine that is called by refere_progress_notify() too.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">helper_routine(progress)<br>{<br>  progress->sub = NULL<br>  pjsip_evsub_set_mod_data(progress->sub, refer_progress_module.id, NULL)</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  /* Remove the ref held by the evsub mod data pointer */<br>  ao2_cleanup(progress)<br>}</pre></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15494">change 15494</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15494"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I97a8bb01771a3c85345649b8124507f7622a8480 </div>
<div style="display:none"> Gerrit-Change-Number: 15494 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 24 Feb 2021 15:55:54 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>