[asterisk-dev] [Code Review] Clean up func_odbc's dummy channel usage.
Tilghman Lesher
tlesher at digium.com
Tue Jun 30 14:39:09 CDT 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/290/#review917
-----------------------------------------------------------
Found some bugs, plus I think a few changes for consistency might be helpful.
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2207>
You need to unlock &queries here before you return.
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2208>
For consistency, I'd prefer that this conditional be: if (!bogus_chan)
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2209>
Ditto here.
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2210>
Unlock queries here.
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2214>
If bogus_chan, then there's no point in doing mode=multirow, because the channel is where we store results. You could check this condition and jump out here.
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2211>
and therefore, chan would always exist here, so this conditional can go away.
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2212>
if (!bogus_chan)
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2213>
Ditto
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2215>
if (!bogus_chan)
The other thing that occurs to me here is that this is within a conditional of "if (resultset), and resultset is only non-NULL if mode=multirow, which, as we've already established, is non-sensical if bogus_chan
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2216>
Ditto
/trunk/funcs/func_odbc.c
<http://reviewboard.digium.com/r/290/#comment2217>
Ditto
- Tilghman
On 2009-06-30 13:54:54, Matthew Nicholson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/290/
> -----------------------------------------------------------
>
> (Updated 2009-06-30 13:54:54)
>
>
> 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 204473
>
> Diff: http://reviewboard.digium.com/r/290/diff
>
>
> Testing
> -------
>
> None.
>
>
> Thanks,
>
> Matthew
>
>
More information about the asterisk-dev
mailing list