lipp / lua-websockets

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

Fail when client use not supported protocol handler #24

Closed DeLaGuardo closed 11 years ago

DeLaGuardo commented 11 years ago

Error


CALLBACK FAILED: /usr/local/share/lua/5.1/websocket/server_ev.lua:104: attempt to index field '?' (a nil value)

Fix


clients[protocol][self] = nil

if clients[protocol] ~= nil and clients[protocol][self] ~= nil then
  clients[protocol][self] = nil
end