[asterisk-dev] [Code Review] 4200: manager: Fix could not extend string messages.
rmudgett
reviewboard at asterisk.org
Fri Nov 21 12:14:31 CST 2014
> On Nov. 20, 2014, 1:19 p.m., Mark Michelson wrote:
> > /branches/13/main/manager.c, line 1850
> > <https://reviewboard.asterisk.org/r/4200/diff/1/?file=69146#file69146line1850>
> >
> > Concatenating all permissions strings together gets a length of ~105. Even allowing for extra room out of safety, using a 128 constant instead of 256 would be appropriate.
Just calculated the max string would be ~121 as there are comma separators to account for. 128 would still work but with very little margin for any new entries. I'll change it to 150.
- rmudgett
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4200/#review13835
-----------------------------------------------------------
On Nov. 19, 2014, 6:08 p.m., rmudgett wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4200/
> -----------------------------------------------------------
>
> (Updated Nov. 19, 2014, 6:08 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> When shutting down Asterisk that has an active AMI connection, you get several "failed to extend from %d to %d" messages because use of the EVENT_FLAG_SHUTDOWN attempts to add all AMI permission strings to the event.
>
> * Created MAX_AUTH_PERM_STRING to use when creating stack based struct ast_str variables used with the authority_to_str() and user_authority_to_str() functions instead of a variety of magic numbers that could be too small.
>
> * Added a special check for EVENT_FLAG_SHUTDOWN to authority_to_str() so it will not attempt to add all permission level strings.
>
> Note: The patch will be applied to v11+ with appropriate updates per branch.
>
>
> Diffs
> -----
>
> /branches/13/main/manager.c 428298
>
> Diff: https://reviewboard.asterisk.org/r/4200/diff/
>
>
> Testing
> -------
>
> With the patch, the "failed to extend from %d to %d" messages no longer happen when shutting down Asterisk that has an AMI connection.
>
>
> Thanks,
>
> rmudgett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141121/2ea7e743/attachment.html>
More information about the asterisk-dev
mailing list