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

Tilghman Lesher tlesher at digium.com
Wed Jul 1 02:12:45 CDT 2009



> On 2009-06-30 19:22:24, Matthew Nicholson wrote:
> > /trunk/funcs/func_odbc.c, line 464
> > <http://reviewboard.digium.com/r/290/diff/2/?file=5813#file5813line464>
> >
> >     I don't understand what you mean here.

In mode=multirow, the way that func_odbc works changes slightly.  Instead of a single row result, we pass back a result ID, which may be used to retrieve multiple rows from the query results.  We store those results in a datastore stored within the channel.  So if there is no channel (but only a bogus channel allocated for variable substitution), then a query which is set for multirow results cannot function, because the storage area for the results does not exist (or really, does not persist long enough for it to be useful).

Hence, within this section, you can avoid collecting results at all, in that limited circumstance.


> On 2009-06-30 19:22:24, Matthew Nicholson wrote:
> > /trunk/funcs/func_odbc.c, line 494
> > <http://reviewboard.digium.com/r/290/diff/2/?file=5813#file5813line494>
> >
> >     Same here.

Sorry, wasn't clear.  I meant that you should replace this with:  if (!bogus_chan)


- Tilghman


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


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