modulemanager: Bump log level of unhandled non-default-namespace elements, and log their full XML

Tue, 06 Oct 2009 23:14:01 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 06 Oct 2009 23:14:01 +0100
changeset 1933
3884a0aac4d7
parent 1932
af8cdbb63b13
child 1934
e14cf28396a8

modulemanager: Bump log level of unhandled non-default-namespace elements, and log their full XML

core/modulemanager.lua file | annotate | diff | comparison | revisions
--- a/core/modulemanager.lua	Tue Oct 06 19:17:28 2009 +0100
+++ b/core/modulemanager.lua	Tue Oct 06 23:14:01 2009 +0100
@@ -247,12 +247,13 @@
 		(handlers[1])(origin, stanza);
 		return true;
 	else
-		log("debug", "Unhandled %s stanza: %s; xmlns=%s", origin.type, stanza.name, xmlns); -- we didn't handle it
 		if stanza.attr.xmlns == "jabber:client" 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
 			origin:close("unsupported-stanza-type");
 		end
 	end

mercurial