lipp / lua-websockets

Websockets for Lua.
http://lipp.github.com/lua-websockets/
MIT License
396 stars 113 forks source link

Fix. Ensure masked value fit to byte. #62

Closed moteus closed 9 years ago

moteus commented 9 years ago

See #61

moteus commented 9 years ago

Tested on Travis

lipp commented 9 years ago

I dont think this is neccassary:

Maybe i dont fully understand this, but this a hotspot and every function call at this point has its cost.

moteus commented 9 years ago

I also thik the same but on travis I get lua: /usr/local/share/lua/5.1/websocket/frame.lua:45: bad argument #2 to 'schar' (invalid value) (https://travis-ci.org/moteus/lua-lluv-websocket/builds/53169714) And with this patch all works (https://travis-ci.org/moteus/lua-lluv-websocket/builds/53181730)

I really did not know why. For now I have only Win XP/2k3

moteus commented 9 years ago

I think i found problem. You unpack mask as signed value and bxor(-XX, v) propogate signed bits. Now all tests passed

lipp commented 9 years ago

:8ball: NICE!