diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-05-04 19:38:21 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-05-04 19:38:21 +0100 |
commit | 42d08e3e931fd5bb2906ed4cc22c4185906addce (patch) | |
tree | 7dc4b85a0e773fc307fb46573798185304163fa0 | |
parent | 504822ae1467c991b82dc1e826831cae2105ec28 (diff) | |
download | prosody-42d08e3e931fd5bb2906ed4cc22c4185906addce.tar.gz prosody-42d08e3e931fd5bb2906ed4cc22c4185906addce.zip |
mod_bosh: Give BOSH sessions a logger (thanks Florob)
-rw-r--r-- | plugins/mod_bosh.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index d15f363d..5aa8ff34 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -11,7 +11,8 @@ local new_uuid = require "util.uuid".generate; local fire_event = require "core.eventmanager".fire_event; local core_process_stanza = core_process_stanza; local st = require "util.stanza"; -local log = require "util.logger".init("bosh"); +local logger = require "util.logger"; +local log = logger.init("mod_bosh"); local stream_callbacks = { stream_tag = "http://jabber.org/protocol/httpbind|body" }; local config = require "core.configmanager"; local xmlns_bosh = "http://jabber.org/protocol/httpbind"; -- (hard-coded into a literal in session.send) @@ -136,8 +137,10 @@ function stream_callbacks.streamopened(request, attr) sid = new_uuid(); local session = { type = "c2s_unauthed", conn = {}, sid = sid, rid = attr.rid, host = attr.to, bosh_version = attr.ver, bosh_wait = attr.wait, streamid = sid, bosh_hold = BOSH_DEFAULT_HOLD, bosh_max_inactive = BOSH_DEFAULT_INACTIVITY, - requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, close = bosh_close_stream, dispatch_stanza = core_process_stanza }; + requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, close = bosh_close_stream, + dispatch_stanza = core_process_stanza, log = logger.init("bosh"..sid) }; sessions[sid] = session; + log("info", "New BOSH session, assigned it sid '%s'", sid); local r, send_buffer = session.requests, session.send_buffer; local response = { headers = default_headers } |