[asterisk-dev] [Code Review] SIP Dialog ref counting in 1.6.0

David Vossel dvossel at digium.com
Tue Jul 7 14:17:10 CDT 2009



> On 2009-07-02 08:31:05, Russell Bryant wrote:
> > /branches/1.6.0/channels/chan_sip.c, lines 20025-20029
> > <http://reviewboard.digium.com/r/302/diff/1/?file=5832#file5832line20025>
> >
> >     I think there is an AST_SCHED macro that does this checking for you.

I know there are some macros for handling replacement, but I don't know of any for handling failure on add alone.  I may be missing something, but after looking through trunk we ref a sip_pvt in ast_sched_add() and usually never check to make sure it succeeded.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/302/#review929
-----------------------------------------------------------


On 2009-07-01 15:10:44, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/302/
> -----------------------------------------------------------
> 
> (Updated 2009-07-01 15:10:44)
> 
> 
> Review request for Asterisk Developers and Russell Bryant.
> 
> 
> Summary
> -------
> 
> This patch adds reference counting for sip dialogs into 1.6.0.
> 
> When proc_session_timer() is called from the scheduler thread it has no guarantee the session timer's dialog won't be freed from underneath it.  Now the session timer holds a reference to the dialog, preventing it from being destroyed during the middle of proc_session_timer().
> 
> 
> This addresses bug 13623.
>     https://issues.asterisk.org/view.php?id=13623
> 
> 
> Diffs
> -----
> 
>   /branches/1.6.0/include/asterisk/sched.h 204652 
>   /branches/1.6.0/channels/chan_sip.c 204652 
> 
> Diff: http://reviewboard.digium.com/r/302/diff
> 
> 
> Testing
> -------
> 
> placed test calls, verified dialogs and session-timers get destroyed on hangup.
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list