[asterisk-dev] [Code Review] Change dynamic features buffer to use ast_str instead of a fixed sized buffer
Mark Michelson
reviewboard at asterisk.org
Tue Dec 4 17:54:15 CST 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2221/#review7488
-----------------------------------------------------------
As is, I'd say this is an improvement that would be trunk-only.
/branches/11/main/features.c
<https://reviewboard.asterisk.org/r/2221/#comment14274>
I'd change this to an ast_assert()
You have measures in place to be sure that you don't pass a NULL pointer into here. If a NULL pointer does happen to slip through to this point, then an assertion should trigger since a programming error has occurred earlier.
/branches/11/main/features.c
<https://reviewboard.asterisk.org/r/2221/#comment14273>
I'm not a big fan of freeing the ast_str in this function. I think it should be freed in the same function that allocates the ast_str.
If you make that change, then you can also change this function to not take a an ast_str**. You can either change it to take
1) A const ast_str *
2) A const char *
Either should be fine.
/branches/11/main/features.c
<https://reviewboard.asterisk.org/r/2221/#comment14272>
These error messages aren't required since allocation failures will already print an error message.
- Mark
On Nov. 30, 2012, 9:16 a.m., elguero wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2221/
> -----------------------------------------------------------
>
> (Updated Nov. 30, 2012, 9:16 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> Currently, the buffer for the dynamic features list is being set to a fixed size of 128. If the list is bigger than that, it obviously results in the dynamic feature not working.
>
> This patch attempts to change the buffer from a fixed size to a dynamic one.
>
> Is this a candidate for all branches?
>
>
> This addresses bug ASTERISK-20680.
> https://issues.asterisk.org/jira/browse/ASTERISK-20680
>
>
> Diffs
> -----
>
> /branches/11/main/features.c 376416
>
> Diff: https://reviewboard.asterisk.org/r/2221/diff
>
>
> Testing
> -------
>
> Local dev box. I was waiting for the reporter to test it as well but I haven't heard back yet.
>
>
> Thanks,
>
> elguero
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121204/474f9238/attachment-0001.htm>
More information about the asterisk-dev
mailing list