[asterisk-dev] [Code Review] 3125: http: support chunked Transfer-Encoding

Mark Michelson reviewboard at asterisk.org
Fri Jan 17 09:21:04 CST 2014



> On Jan. 16, 2014, 5 p.m., Mark Michelson wrote:
> > /branches/12/main/http.c, line 813
> > <https://reviewboard.asterisk.org/r/3125/diff/2/?file=52892#file52892line813>
> >
> >     chunked_atoh shouldn't be necessary. You should be able to just use:
> >     
> >     sscanf(chunk_header, %x, &chunk_length);
> >     
> >     You would need to change chunk_length to be an unsigned int instead of an int, but that's fine since the length will never be negative.
> 
> Scott Griepentrog wrote:
>     I had considered that, but I wanted to be overly cautious and throw extra checking into the algorithm, such that any invalid character or unexpected sequence would result in an error, rather than partial input and confused results.
>

Fair enough. I'll add my ship it since that's the only thing I noticed.


- Mark


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


On Jan. 13, 2014, 11:26 p.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3125/
> -----------------------------------------------------------
> 
> (Updated Jan. 13, 2014, 11:26 p.m.)
> 
> 
> Review request for Asterisk Developers and Matt Jordan.
> 
> 
> Bugs: ASTERISK-23068
>     https://issues.asterisk.org/jira/browse/ASTERISK-23068
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Implements support for HTTP chunked mode Transfer-Encoding in JSON and Form (post vars) body content.  Relocated code from ast_http_get_json() and ast_http_get_post_vars() that reads content from stream into new function ast_http_get_contents(), and added support for reading and decoding chunked mode transfers.
> 
> 
> Diffs
> -----
> 
>   /branches/12/main/http.c 405282 
> 
> Diff: https://reviewboard.asterisk.org/r/3125/diff/
> 
> 
> Testing
> -------
> 
> Testsuite test rest_api/chunked_transfer added (see https://reviewboard.asterisk.org/r/3126/) to insure correct operation of chunked and regular mode.
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

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


More information about the asterisk-dev mailing list