Software / code / prosody
Comparison
core/componentmanager.lua @ 1772:c0ba9cd6ee63
ComponentManager: Fixed a bit of logging.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Fri, 11 Sep 2009 16:17:18 +0500 |
| parent | 1705:99c9f59ed365 |
| child | 1773:f47aa1d336b5 |
comparison
equal
deleted
inserted
replaced
| 1771:39e6b986ef01 | 1772:c0ba9cd6ee63 |
|---|---|
| 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 |