Comparison

net/xmppclient_listener.lua @ 1605:f6bd13fe1cb1

xmpp{client,server}_listener: Report contents of packets containing invalid XML
author Matthew Wild <mwild1@gmail.com>
date Sun, 26 Jul 2009 20:58:37 +0100
parent 1560:a8c14a350de5
child 1618:ba2a92230b77
comparison
equal deleted inserted replaced
1604:5097583259e0 1605:f6bd13fe1cb1
59 session.notopen = true; 59 session.notopen = true;
60 60
61 function session.data(conn, data) 61 function session.data(conn, data)
62 local ok, err = parser:parse(data); 62 local ok, err = parser:parse(data);
63 if ok then return; end 63 if ok then return; end
64 log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "));
64 session:close("xml-not-well-formed"); 65 session:close("xml-not-well-formed");
65 end 66 end
66 67
67 return true; 68 return true;
68 end 69 end