[asterisk-dev] [Code Review] Create API for doing variable substitution with dynamic buffers

Russell Bryant russell at digium.com
Mon Mar 30 15:56:09 CDT 2009


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



/trunk/apps/app_macro.c
<http://reviewboard.digium.com/r/174/#comment1673>

    It looks like Macro() will fail to work, as tmp_subst will _always_ be NULL here.



/trunk/funcs/func_aes.c
<http://reviewboard.digium.com/r/174/#comment1674>

    left over debug



/trunk/funcs/func_aes.c
<http://reviewboard.digium.com/r/174/#comment1676>

    What is the purpose of having both read and read2 implemented?
    
    Also, for the ast_str version, what is maxlen useful for when the buffer is dynamic anyway?



/trunk/include/asterisk/pbx.h
<http://reviewboard.digium.com/r/174/#comment1669>

    Is the purpose of this just API compatibility so you don't have to go and change as much code?  Can you document it as such?



/trunk/include/asterisk/pbx.h
<http://reviewboard.digium.com/r/174/#comment1670>

    Please add full API documentation to all new API calls.



/trunk/include/asterisk/pbx.h
<http://reviewboard.digium.com/r/174/#comment1671>

    API documentation needed.



/trunk/include/asterisk/pbx.h
<http://reviewboard.digium.com/r/174/#comment1672>

    API documentation needed.


- Russell


On 2009-03-30 15:26:04, Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/174/
> -----------------------------------------------------------
> 
> (Updated 2009-03-30 15:26:04)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> We currently have a variable substitution system that depends upon static buffers.  This has issues, both because it takes up 12k of stack each time through nested variable expressions, but also because in some newer cases, the 4k limit on the size of the buffer is no longer sufficient.  So this is a conversion that allows us to use dynamic string buffers in place of the old static buffers.
> 
> Additionally, note that this is a subset of the changes done, to make review of the changes easier.
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_exec.c 185116 
>   /trunk/apps/app_macro.c 185116 
>   /trunk/apps/app_minivm.c 185116 
>   /trunk/apps/app_voicemail.c 185116 
>   /trunk/cdr/cdr_custom.c 185116 
>   /trunk/funcs/func_aes.c 185116 
>   /trunk/funcs/func_base64.c 185116 
>   /trunk/funcs/func_blacklist.c 185116 
>   /trunk/funcs/func_callerid.c 185116 
>   /trunk/funcs/func_curl.c 185116 
>   /trunk/funcs/func_cut.c 185116 
>   /trunk/funcs/func_db.c 185116 
>   /trunk/funcs/func_dialplan.c 185116 
>   /trunk/funcs/func_env.c 185116 
>   /trunk/funcs/func_extstate.c 185116 
>   /trunk/funcs/func_groupcount.c 185116 
>   /trunk/funcs/func_lock.c 185116 
>   /trunk/funcs/func_logic.c 185116 
>   /trunk/funcs/func_md5.c 185116 
>   /trunk/funcs/func_module.c 185116 
>   /trunk/funcs/func_rand.c 185116 
>   /trunk/funcs/func_sha1.c 185116 
>   /trunk/funcs/func_speex.c 185116 
>   /trunk/funcs/func_strings.c 185116 
>   /trunk/funcs/func_sysinfo.c 185116 
>   /trunk/funcs/func_timeout.c 185116 
>   /trunk/funcs/func_vmcount.c 185116 
>   /trunk/include/asterisk/ast_expr.h 185116 
>   /trunk/include/asterisk/pbx.h 185116 
>   /trunk/main/ast_expr2f.c 185116 
>   /trunk/main/pbx.c 185116 
>   /trunk/main/strings.c 185116 
>   /trunk/res/res_agi.c 185116 
>   /trunk/res/res_config_curl.c 185116 
>   /trunk/res/res_phoneprov.c 185116 
> 
> Diff: http://reviewboard.digium.com/r/174/diff
> 
> 
> Testing
> -------
> 
> Extensive testing has been done on the new core API substitution call, though limited testing has only been done on the multiple places in the code where the new API has replaced the old substitution.
> 
> 
> Thanks,
> 
> Tilghman
> 
>




More information about the asterisk-dev mailing list