From d2e54407980844a76431f2b4f450606d2d710295 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 12 May 2012 01:47:53 +0100 Subject: stanza_router: Close stream for unhandled stanzas from unauthenticated connections (we can't reply) --- core/stanza_router.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/stanza_router.lua') diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 4c241c27..1a3d1322 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -28,13 +28,13 @@ local function handle_unhandled_stanza(host, origin, stanza) return true; end end - if stanza.attr.xmlns == nil then + if stanza.attr.xmlns == nil and origin.send then log("debug", "Unhandled %s stanza: %s; xmlns=%s", origin.type, stanza.name, xmlns); -- we didn't handle it if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end elseif not((name == "features" or name == "error") and xmlns == "http://etherx.jabber.org/streams") then -- FIXME remove check once we handle S2S features - log("warn", "Unhandled %s stream element: %s; xmlns=%s: %s", origin.type, stanza.name, xmlns, tostring(stanza)); -- we didn't handle it + log("warn", "Unhandled %s stream element or stanza: %s; xmlns=%s: %s", origin.type, stanza.name, xmlns, tostring(stanza)); -- we didn't handle it origin:close("unsupported-stanza-type"); end end -- cgit v1.2.3