[asterisk-dev] [Code Review] 3745: func_uri: URIENCODE/URIDECODE - Remove warning messages when empty string is passed for the argument

rmudgett reviewboard at asterisk.org
Fri Jul 11 11:15:25 CDT 2014


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



/branches/1.8/funcs/func_uri.c
<https://reviewboard.asterisk.org/r/3745/#comment22848>

    Since passing an empty argument is valid the function shouldn't return -1 but set the buffer to an empty string and return 0.
    
    The same for the decode.


- rmudgett


On July 11, 2014, 11:09 a.m., Jonathan Rose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3745/
> -----------------------------------------------------------
> 
> (Updated July 11, 2014, 11:09 a.m.)
> 
> 
> Review request for Asterisk Developers and Matt Jordan.
> 
> 
> Bugs: ASTERISK-23911
>     https://issues.asterisk.org/jira/browse/ASTERISK-23911
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> WARNING[4943]: func_uri.c:79 uriencode: Syntax: URIENCODE(<data>) - missing argument!
> 
> There is nothing especially wrong with trying to encode an empty string, so there is no need to warn for it.
> Plus avoiding the warning requires making some dialplans more elaborate.  This:
> 
> same => n,Stasis(myapp,${URIENCODE(${ARGS}))
> 
> becomes this:
> 
> same => n,GotoIf($[${LEN(${ARGS})} = 0]skip:)
> same => n,Set(ARGS=${URIENCODE(${ARGS})})
> same => n(skip),NoOp()
> same => n,Stasis(MyApp,${ARGS})
> 
> for instance.
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/funcs/func_uri.c 418366 
> 
> Diff: https://reviewboard.asterisk.org/r/3745/diff/
> 
> 
> Testing
> -------
> 
> Checked to make sure the warning doesn't get generated anymore.  It doesn't.
> 
> 
> Thanks,
> 
> Jonathan Rose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140711/43f9c235/attachment-0001.html>


More information about the asterisk-dev mailing list