Merged from Matthew

Thu, 23 Oct 2008 22:07:36 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Thu, 23 Oct 2008 22:07:36 +0500
changeset 136
39dc16f3bf55
parent 135
bf10d42dd41b (current diff)
parent 126
63863534b1f1 (diff)
child 137
9a05dfb35dd5

Merged from Matthew

--- a/core/sessionmanager.lua	Thu Oct 23 21:51:00 2008 +0500
+++ b/core/sessionmanager.lua	Thu Oct 23 22:07:36 2008 +0500
@@ -1,6 +1,6 @@
 
 local tonumber, tostring = tonumber, tostring;
-local ipairs, pairs, print= ipairs, pairs, print;
+local ipairs, pairs, print, next= ipairs, pairs, print, next;
 local collectgarbage = collectgarbage;
 local m_random = import("math", "random");
 local format = import("string", "format");
@@ -39,7 +39,9 @@
 		if session.resource then
 			hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
 		end
-		if not next(hosts[session.host].sessions[session.username], nil) then
+		
+		if not next(hosts[session.host].sessions[session.username].sessions) then
+			log("debug", "All resources of %s are now offline", session.username);
 			hosts[session.host].sessions[session.username] = nil;
 		end
 	end

mercurial