Diff

net/xmppserver_listener.lua @ 1877:23c39f66406f

xmppserver_listener: Better log messages on invalid XML
author Matthew Wild <mwild1@gmail.com>
date Sun, 04 Oct 2009 14:15:36 +0100
parent 1686:232c2bf155c7
child 1878:a8d57d5faec5
line wrap: on
line diff
--- a/net/xmppserver_listener.lua	Sun Oct 04 14:10:24 2009 +0100
+++ b/net/xmppserver_listener.lua	Sun Oct 04 14:15:36 2009 +0100
@@ -61,7 +61,8 @@
 		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]+", " "));
+			session.log("warn", "Received invalid XML: %s", data);
+			session.log("warn", "Problem was: %s", err);
 			session:close("xml-not-well-formed");
 		end