[asterisk-dev] [Code Review] func_curl: make it report errors like "server certificate verification failed" instead of returning silently

Tilghman Lesher reviewboard at asterisk.org
Tue Mar 19 10:31:43 CDT 2013


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



/branches/1.8/funcs/func_curl.c
<https://reviewboard.asterisk.org/r/2403/#comment15532>

    Given that this is a static buffer, I think stylistically, it would be better for it to be declared at the top of the function, rather than in a separate block.  I think we generally only do the separate block under very special circumstances, and this isn't one of them.



/branches/1.8/funcs/func_curl.c
<https://reviewboard.asterisk.org/r/2403/#comment15533>

    It's not clear from the documented libcurl API that this will do what you expect.  The API suggests that you should instead be using CURLOPT_STDERR to turn off the buffer.


- Tilghman


On March 19, 2013, 7:10 a.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2403/
> -----------------------------------------------------------
> 
> (Updated March 19, 2013, 7:10 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Failed CURL() requests would be quite silent.
> 
> Now you get nice warnings like this:
> 
>   WARNING[6701]: func_curl.c:654 acf_curl_helper: server certificate verification failed. \
>     CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none ('https://ORIGINAL_URL')
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/funcs/func_curl.c 383308 
> 
> Diff: https://reviewboard.asterisk.org/r/2403/diff
> 
> 
> Testing
> -------
> 
> It works.
> 
> I also tested that setting CURLOPT_ERRORBUFFER to NULL does what you'd expect. (And the cast is to silent the fancy gcc type checks.)
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130319/5a99c92e/attachment.htm>


More information about the asterisk-dev mailing list