kernelsauce / turbo

Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses.
http://turbo.readthedocs.io/
Apache License 2.0
528 stars 84 forks source link

fix in websocket.lua #151

Closed alisabri closed 9 years ago

alisabri commented 9 years ago

In websocket api, if payload>=126 then payload length is incorrectly computed. Stems from the lines 212-213 in websocket.lua: in function "_frame_len_16(data)", data is string type so; ffi.cast("uint16_t", data) casts data's address instead of the value pointed that address.

Have not tested but the same should be true for the following function "_frame_len_64(data)"

kernelsauce commented 9 years ago

Thank you, would you mind fixing the 64 bit frame length calculation too? Or should I do it?

alisabri commented 9 years ago

Hi, Sure I can do.

Regards,

kernelsauce commented 9 years ago

Already fixed it; https://github.com/kernelsauce/turbo/commit/7f377503da26500acc4ac1f90d6540e536c254bf

alisabri commented 9 years ago

Thanks, that is better