lipp / lua-websockets

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

Fix. Use global `unpack` is not compatible with Lua 5.2 #61

Closed moteus closed 9 years ago

moteus commented 9 years ago

Minor performance improvements

lipp commented 9 years ago

great!

moteus commented 9 years ago

Sorry. I tests this ony on my Windows x32. I just run test on travis and get

/usr/local/share/lua/5.1/websocket/frame.lua:45: bad argument #2 to 'schar' (invalid value)

But I have no idea how it can be. Mask generates as mrandom(0,0xff) original generates by sting.byte and how bxor(original[i],mask[j]) may be not valid I do not know. May be on some machine sting.byte returns negative value? so then we have to use transformed[i] = band(bxor(original[i],mask[j]), 0xff) I can do PR just now