Skip to content

Commit

Permalink
mod_stream_management: fix nasty session leak, fitting this in 3.1 as…
Browse files Browse the repository at this point in the history
… it must be. (Fixes #43)
  • Loading branch information
maranda committed Nov 17, 2013
1 parent 9f2b351 commit 0e6b32c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/mod_stream_management.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ local function wrap(session, _r) -- SM session wrapper

local close = session.close;
function session.close(...)
local token = session.sm_token;
local token = session.token;
if token then
handled_sessions[token] = nil;
session.sm_token = nil;
session.token = nil;
end
return close(...);
end
Expand Down Expand Up @@ -277,7 +277,6 @@ end);

module:hook("pre-resource-unbind", function(event)
local session, _error = event.session, event.error;
if session.halted then return true; end
if session.sm then
if session.token then
session.log("debug", "Session is being halted for up to %d seconds", timeout);
Expand Down

0 comments on commit 0e6b32c

Please sign in to comment.