13 local core_route_stanza = core_route_stanza; |
13 local core_route_stanza = core_route_stanza; |
14 local jid_split = require "util.jid".split; |
14 local jid_split = require "util.jid".split; |
15 local events_new = require "util.events".new; |
15 local events_new = require "util.events".new; |
16 local st = require "util.stanza"; |
16 local st = require "util.stanza"; |
17 local hosts = hosts; |
17 local hosts = hosts; |
18 local serialize = require "util.serialization".serialize |
|
19 |
18 |
20 local pairs, type, tostring = pairs, type, tostring; |
19 local pairs, type, tostring = pairs, type, tostring; |
21 |
20 |
22 local components = {}; |
21 local components = {}; |
23 |
22 |
64 end |
63 end |
65 if component then |
64 if component then |
66 log("debug", "%s stanza being handled by component: %s", stanza.name, host); |
65 log("debug", "%s stanza being handled by component: %s", stanza.name, host); |
67 component(origin, stanza, hosts[host]); |
66 component(origin, stanza, hosts[host]); |
68 else |
67 else |
69 log("error", "Component manager recieved a stanza for a non-existing component: " .. (stanza.attr.to or serialize(stanza))); |
68 log("error", "Component manager recieved a stanza for a non-existing component: "..tostring(stanza)); |
70 end |
69 end |
71 end |
70 end |
72 |
71 |
73 function create_component(host, component) |
72 function create_component(host, component) |
74 -- TODO check for host well-formedness |
73 -- TODO check for host well-formedness |