[asterisk-dev] [Code Review]: Add IPv6 Support To Manager

Terry Wilson reviewboard at asterisk.org
Thu Jun 7 14:47:09 CDT 2012



> On June 6, 2012, 7:54 a.m., Simon Perreault wrote:
> > /trunk/main/manager.c, line 6997
> > <https://reviewboard.asterisk.org/r/1968/diff/1/?file=28535#file28535line6997>
> >
> >     What's wrong with atoi()? Why not keep using it?
> 
> Kevin Fleming wrote:
>     atoi() does not have the ability to report errors (strings it cannot parse result in '0' results). It will accept '35foobar' and return 35, at least on some platforms. sscanf() has none of these problems, so we prefer it for configuration parsing so that we can tell the user if they've likely done something wrong.
> 
> Simon Perreault wrote:
>     This is becoming off-topic, but have you thought about importing strtonum() from OpenBSD?
>     
>     http://www.openbsd.org/cgi-bin/man.cgi?query=strtonum
>     http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/strtonum.c?rev=1.6
> 
> Kevin Fleming wrote:
>     I'm not aware of any discussions along those lines, no. We've been satisfied with using sscanf().

actually, we also have ast_parse_arg() for parsing a variety strings to other types (int, unsigned int, double, boolean, etc. It uses strtol for ints and reports errors, supports default values, and specifying valid ranges.


- Terry


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1968/#review6385
-----------------------------------------------------------


On June 5, 2012, 10 p.m., elguero wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1968/
> -----------------------------------------------------------
> 
> (Updated June 5, 2012, 10 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Adding support for IPv6 communication to the manager.
> 
> 
> This addresses bug ASTERISK-19965.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19965
> 
> 
> Diffs
> -----
> 
>   /trunk/main/manager.c 368584 
>   /trunk/CHANGES 368584 
> 
> Diff: https://reviewboard.asterisk.org/r/1968/diff
> 
> 
> Testing
> -------
> 
> Fedora 16 dev box
> Centos 5.8 test box
> 
> Tested only AMI and HTTP...
> 
> 
> Thanks,
> 
> elguero
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120607/660b521a/attachment.htm>


More information about the asterisk-dev mailing list