diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-01-22 22:55:49 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-01-22 22:55:49 +0000 |
commit | 4d7ce5ef98953b67c80cc7f2fc347f01ad9cdd4e (patch) | |
tree | acc1b9c5576f0ba21b56fd5b133a4a173798d042 /core/hostmanager.lua | |
parent | b803655fc3922d51ccfb44eebe8540e3ba562b2b (diff) | |
parent | 075f0cbd7c732c108e03ec8596e9934db7b8b06a (diff) | |
download | prosody-4d7ce5ef98953b67c80cc7f2fc347f01ad9cdd4e.tar.gz prosody-4d7ce5ef98953b67c80cc7f2fc347f01ad9cdd4e.zip |
Merge with trunk
Diffstat (limited to 'core/hostmanager.lua')
-rw-r--r-- | core/hostmanager.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/hostmanager.lua b/core/hostmanager.lua index 9e74cd6b..0dd1d426 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -53,6 +53,17 @@ end prosody_events.add_handler("server-starting", load_enabled_hosts); +local function host_send(stanza) + local name, type = stanza.name, stanza.attr.type; + if type == "error" or (name == "iq" and type == "result") then + local dest_host_name = select(2, jid_split(stanza.attr.to)); + local dest_host = hosts[dest_host_name] or { type = "unknown" }; + log("warn", "Unhandled response sent to %s host %s: %s", dest_host.type, dest_host_name, tostring(stanza)); + return; + end + core_route_stanza(nil, stanza); +end + function activate(host, host_config) if hosts[host] then return nil, "The host "..host.." is already activated"; end host_config = host_config or configmanager.getconfig()[host]; @@ -63,6 +74,7 @@ function activate(host, host_config) events = events_new(); dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen(); disallow_s2s = configmanager.get(host, "core", "disallow_s2s"); + send = host_send; }; if not host_config.core.component_module then -- host host_session.type = "local"; |