# HG changeset patch # User Waqas Hussain # Date 1226007524 -18000 # Node ID 641dbdf3b75152432538a9cf31b6763e27d74884 # Parent f06e97f525bc23b125a97870952b61bcb9016077 Shortened log output for incoming stanzas and an added check. diff -r f06e97f525bc -r 641dbdf3b751 core/stanza_router.lua --- a/core/stanza_router.lua Thu Nov 06 16:57:10 2008 +0500 +++ b/core/stanza_router.lua Fri Nov 07 02:38:44 2008 +0500 @@ -31,7 +31,7 @@ local print = print; function core_process_stanza(origin, stanza) - log("debug", "Received["..origin.type.."]: "..tostring(stanza)) + log("debug", "Received["..origin.type.."]: "..tostring(st.reply(st.reply(stanza)))) -- TODO verify validity of stanza (as well as JID validity) if stanza.name == "iq" and not(#stanza.tags == 1 and stanza.tags[1].attr.xmlns) then @@ -81,7 +81,7 @@ component_handle_stanza(origin, stanza); elseif hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource component_handle_stanza(origin, stanza); - elseif hosts[host].type == "component" then -- directed at a component + elseif hosts[host] and hosts[host].type == "component" then -- directed at a component component_handle_stanza(origin, stanza); elseif origin.type == "c2s" and stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare);