[asterisk-dev] [Code Review] CLI command 'manager logout <username> [from <ipaddress>]'
Russell Bryant
russell at digium.com
Sun Dec 14 06:31:44 CST 2008
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/77/#review220
-----------------------------------------------------------
/trunk/main/manager.c
<http://reviewboard.digium.com/r/77/#comment430>
1) You need to unlock before calling free_session().
2) There appears to be a bad race condition here. This code assumes that the TCP connection handling thread has exited immediately after sending it a SIGURG. It seems quite possible that this CLI command handler could free the session while another thread is still using it.
Solving this is going to require taking a closer look at the way session objects are used in manager.c. However, I'm thinking that the proper solution is going to be to set a flag on the session indicating that it has been logged out, and let the main session handling thread deal with destroying it when it is safe to do so.
- Russell
On 2008-12-04 08:55:44, Eliel Sardañons wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/77/
> -----------------------------------------------------------
>
> (Updated 2008-12-04 08:55:44)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> CLI command 'manager logout <username> [from <ipaddress>]' as discussed on the mailing list (-dev).
> Please review twice the way I am logging out the user (how I am using the locks).
>
>
> Diffs
> -----
>
> /trunk/CHANGES 160895
> /trunk/main/manager.c 160895
>
> Diff: http://reviewboard.digium.com/r/77/diff
>
>
> Testing
> -------
>
> Developer testing.
>
>
> Thanks,
>
> Eliel
>
>
More information about the asterisk-dev
mailing list