diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-05-12 01:47:53 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-05-12 01:47:53 +0100 |
commit | c0c107c9e93f4a694e1536c6a94dbb1455b0159c (patch) | |
tree | e568b3aac9748a1fbe9d7c23f3c9702fd5917ed3 | |
parent | 2cf49c8f3765ef4e1cfc4824d9f7e25238b2172f (diff) | |
download | prosody-c0c107c9e93f4a694e1536c6a94dbb1455b0159c.tar.gz prosody-c0c107c9e93f4a694e1536c6a94dbb1455b0159c.zip |
stanza_router: Close stream for unhandled stanzas from unauthenticated connections (we can't reply)
-rw-r--r-- | core/stanza_router.lua | 4 |
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 |