Diff

plugins/mod_bosh.lua @ 1112:e8a00a2ea910

Merge with 0.4
author Matthew Wild <mwild1@gmail.com>
date Mon, 04 May 2009 19:57:05 +0100
parent 1050:9552c08241af
parent 1109:bb21eb3cd364
child 1522:569d58d21612
line wrap: on
line diff
--- a/plugins/mod_bosh.lua	Sun May 03 17:24:57 2009 +0100
+++ b/plugins/mod_bosh.lua	Mon May 04 19:57:05 2009 +0100
@@ -12,7 +12,8 @@
 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)
@@ -137,8 +138,10 @@
 		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 }