net.http, net.http.server, mod_c2s, mod_s2s, mod_component, mod_admin_telnet, mod_net_multiplex: Add ondetach to release connection from 'sessions' table (or equivalent)

This commit is contained in:
Matthew Wild 2014-08-29 11:54:34 +01:00
parent 257d0f104b
commit 899b6d53ae
7 changed files with 26 additions and 1 deletions

View file

@ -266,6 +266,10 @@ function listener.associate_session(conn, session)
sessions[conn] = session;
end
function listener.ondetach(conn)
sessions[conn] = nil;
end
module:hook("server-stopping", function(event)
local reason = event.reason;
for _, session in pairs(sessions) do