[asterisk-dev] [Code Review]: WebSocket HTTP Module

Joshua Colp reviewboard at asterisk.org
Wed May 30 14:22:46 CDT 2012



> On May 30, 2012, 2:02 p.m., wdoekes wrote:
> > /trunk/res/res_http_websocket.c, lines 323-328
> > <https://reviewboard.asterisk.org/r/1952/diff/2/?file=28404#file28404line323>
> >
> >     How about:
> >     
> >       *payload = &buf[4];
> >     
> >     And first after this big if/elseif a
> >     
> >       if(mask_present) {
> >         mask = *payload;
> >         *payload += 4;
> >       }
> >     
> >     Looks like that would fix a couple of newly introduced offset bugs below too. (8/4=>ok, 12/10=>huh?, 6/6=>huh? Should be: 8/4, 14/10, 6/2, right?)

You get a bonus point for this. I've redone it.


> On May 30, 2012, 2:02 p.m., wdoekes wrote:
> > /trunk/res/res_http_websocket.c, lines 556-565
> > <https://reviewboard.asterisk.org/r/1952/diff/2/?file=28404#file28404line556>
> >
> >     Another s/fprintf/fputs/... or a s/ast_str_set/fprintf/

Switched to fprintf!


- Joshua


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


On May 30, 2012, 12:32 p.m., Joshua Colp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1952/
> -----------------------------------------------------------
> 
> (Updated May 30, 2012, 12:32 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This adds support for WebSocket protocols 7, 8, and 13. These are the most recent protocols. Sending and receiving text/binary frames is supported along with the various operation codes. An API is provided which makes it easy to implement different sub-protocols. Frame reconstruction is supported for situations where desirable (if multiple frames are received they will be reconstructed into a single one) but this can be disabled in situations where streaming is wanted.
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/http_websocket.h PRE-CREATION 
>   /trunk/include/asterisk/utils.h 360141 
>   /trunk/main/utils.c 360141 
>   /trunk/res/res_http_websocket.c PRE-CREATION 
>   /trunk/res/res_http_websocket.exports.in PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/1952/diff
> 
> 
> Testing
> -------
> 
> Tested using Google Chrome Canary to confirm connection is established and data can be sent and received.
> 
> Tested using websocket.py to confirm connection is established and data can be sent and received.
> 
> 
> Thanks,
> 
> Joshua
> 
>

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


More information about the asterisk-dev mailing list