diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-07-28 01:14:31 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-07-28 01:14:31 +0100 |
commit | 81bef2c93b53e006cbeebdffc80040af6b4daf68 (patch) | |
tree | 2732225257e7b8ade28695dad7c0df3f7cea00b1 /core/sessionmanager.lua | |
parent | 8eec29745633bd84c2d325d42dbeeb4afd37d516 (diff) | |
parent | 47619af14cd24fcb48b4d2b4c4653f72b882087e (diff) | |
download | prosody-81bef2c93b53e006cbeebdffc80040af6b4daf68.tar.gz prosody-81bef2c93b53e006cbeebdffc80040af6b4daf68.zip |
Merge with Florob
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r-- | core/sessionmanager.lua | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 37c1626a..6945b8de 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -6,8 +6,8 @@ -- COPYING file in the source package for more information. -- -local tonumber, tostring, setmetatable = tonumber, tostring, setmetatable; -local ipairs, pairs, print, next= ipairs, pairs, print, next; +local tostring, setmetatable = tostring, setmetatable; +local pairs, next= pairs, next; local hosts = hosts; local full_sessions = full_sessions; @@ -15,7 +15,6 @@ local bare_sessions = bare_sessions; local logger = require "util.logger"; local log = logger.init("sessionmanager"); -local error = error; local rm_load_roster = require "core.rostermanager".load_roster; local config_get = require "core.configmanager".get; local resourceprep = require "util.encodings".stringprep.resourceprep; @@ -23,12 +22,8 @@ local nodeprep = require "util.encodings".stringprep.nodeprep; local uuid_generate = require "util.uuid".generate; local initialize_filters = require "util.filters".initialize; -local fire_event = prosody.events.fire_event; -local add_task = require "util.timer".add_task; local gettime = require "socket".gettime; -local st = require "util.stanza"; - local newproxy = newproxy; local getmetatable = getmetatable; @@ -43,7 +38,7 @@ function new_session(conn) getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end; end open_sessions = open_sessions + 1; - log("debug", "open sessions now: ".. open_sessions); + log("debug", "open sessions now: %d", open_sessions); local filter = initialize_filters(session); local w = conn.write; @@ -82,13 +77,13 @@ function retire_session(session) end end - function session.send(data) log("debug", "Discarding data sent to resting session: %s", tostring(data)); end + function session.send(data) log("debug", "Discarding data sent to resting session: %s", tostring(data)); return false; end function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end return setmetatable(session, resting_session); end function destroy_session(session, err) - (session.log or log)("info", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or ""); + (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or ""); if session.destroyed then return; end -- Remove session/resource from user's session list |