net.xmppcomponent_listener: Log invalid XML received from components (as we already do for c2s/s2s)

Sun, 14 Mar 2010 03:06:19 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 14 Mar 2010 03:06:19 +0000
changeset 2758
0476a662dacc
parent 2757
c13816e0c546
child 2759
48e8832e5cab

net.xmppcomponent_listener: Log invalid XML received from components (as we already do for c2s/s2s)

net/xmppcomponent_listener.lua file | annotate | diff | comparison | revisions
--- a/net/xmppcomponent_listener.lua	Sun Mar 14 03:05:43 2010 +0000
+++ b/net/xmppcomponent_listener.lua	Sun Mar 14 03:06:19 2010 +0000
@@ -164,6 +164,7 @@
 		function session.data(conn, data)
 			local ok, err = parser:parse(data);
 			if ok then return; end
+			log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
 			session:close("xml-not-well-formed");
 		end
 		

mercurial