aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-12 01:47:53 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-12 01:47:53 +0100
commitd2e54407980844a76431f2b4f450606d2d710295 (patch)
treee568b3aac9748a1fbe9d7c23f3c9702fd5917ed3
parent7aac87fba842b093bbb339dff9f8c6f305e1faa8 (diff)
downloadprosody-d2e54407980844a76431f2b4f450606d2d710295.tar.gz
prosody-d2e54407980844a76431f2b4f450606d2d710295.zip
stanza_router: Close stream for unhandled stanzas from unauthenticated connections (we can't reply)
-rw-r--r--core/stanza_router.lua4
1 files changed, 2 insertions, 2 deletions
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