[asterisk-dev] [Code Review] Clean up func_odbc's dummy channel usage.

Tilghman Lesher tlesher at digium.com
Fri Jun 26 22:00:11 CDT 2009



> On 2009-06-23 21:49:19, Tilghman Lesher wrote:
> > /trunk/funcs/func_odbc.c, lines 243-248
> > <http://reviewboard.digium.com/r/290/diff/1/?file=5717#file5717line243>
> >
> >     I'm not really sold on this change.  Add an else clause, if you want to handle the error, instead of changing how this works.
> 
>  wrote:
>     This change was made to match the way other parts of asterisk handle channel allocation failure.

I specifically meant changing this to:

if (!(chan = ast_channel_alloc(...))) {
    return -1;
}
bogus_chan = 1;

which is a nice compound statement, in line with the way that we now structure error tests and conditions.  That is, test the return value immediately and handle the error, instead of doing it in two different statements.


- Tilghman


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


On 2009-06-23 17:54:19, Matthew Nicholson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/290/
> -----------------------------------------------------------
> 
> (Updated 2009-06-23 17:54:19)
> 
> 
> Review request for Asterisk Developers and Tilghman Lesher.
> 
> 
> Summary
> -------
> 
> This patch cleans up func_odbc's use of dummy channels a bit.  This is accomplished by releasing the dummy channel after we no longer need it and skipping sections of code that are pointless to execute without a channel.
> 
> 
> Diffs
> -----
> 
>   /trunk/funcs/func_odbc.c 202792 
> 
> Diff: http://reviewboard.digium.com/r/290/diff
> 
> 
> Testing
> -------
> 
> None.
> 
> 
> Thanks,
> 
> Matthew
> 
>




More information about the asterisk-dev mailing list