Comparison

core/stanza_router.lua @ 1971:91420df04d5b

stanza_router: Localize hosts, full_sessions and bare_sessions, and take from the prosody object instead of _G
author Matthew Wild <mwild1@gmail.com>
date Sat, 17 Oct 2009 13:33:23 +0100
parent 1900:93a94ec05ebe
child 1985:9b352c8a32e6
comparison
equal deleted inserted replaced
1970:edab0c61fc02 1971:91420df04d5b
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local log = require "util.logger".init("stanzarouter") 9 local log = require "util.logger".init("stanzarouter")
10 10
11 local hosts = _G.hosts; 11 local hosts = _G.prosody.hosts;
12 local tostring = tostring; 12 local tostring = tostring;
13 local st = require "util.stanza"; 13 local st = require "util.stanza";
14 local send_s2s = require "core.s2smanager".send_to_host; 14 local send_s2s = require "core.s2smanager".send_to_host;
15 local modules_handle_stanza = require "core.modulemanager".handle_stanza; 15 local modules_handle_stanza = require "core.modulemanager".handle_stanza;
16 local component_handle_stanza = require "core.componentmanager".handle_stanza; 16 local component_handle_stanza = require "core.componentmanager".handle_stanza;
17 local jid_split = require "util.jid".split; 17 local jid_split = require "util.jid".split;
18 local jid_prepped_split = require "util.jid".prepped_split; 18 local jid_prepped_split = require "util.jid".prepped_split;
19
20 local full_sessions = _G.prosody.full_sessions;
21 local bare_sessions = _G.prosody.bare_sessions;
19 22
20 function core_process_stanza(origin, stanza) 23 function core_process_stanza(origin, stanza)
21 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) 24 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag())
22 25
23 -- Currently we guarantee every stanza to have an xmlns, should we keep this rule? 26 -- Currently we guarantee every stanza to have an xmlns, should we keep this rule?