Changeset

1366:f581210093a7

mod_c2s_limit_sessions: Fix global access
author Kim Alvefur <zash@zash.se>
date Wed, 19 Mar 2014 23:17:55 +0100
parents 1365:ecc948f8d47d
children 1367:103d685e2153
files mod_c2s_limit_sessions/mod_c2s_limit_sessions.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_c2s_limit_sessions/mod_c2s_limit_sessions.lua	Wed Mar 19 23:11:33 2014 +0100
+++ b/mod_c2s_limit_sessions/mod_c2s_limit_sessions.lua	Wed Mar 19 23:17:55 2014 +0100
@@ -6,7 +6,8 @@
 
 local sessions = hosts[module.host].sessions;
 module:hook("resource-bind", function(event)
-	if count(next, sessions[event.session.username].sessions) > max_resources then
+	local session = event.session;
+	if count(next, sessions[session.username].sessions) > max_resources then
 		session:close{ condition = "policy-violation", text = "Too many resources" };
 		return false
 	end