Comparison

plugins/mod_s2s/mod_s2s.lua @ 9784:7fa273f8869e

mod_c2s, mod_s2s, mod_component: Log invalid XML escaped (fixes #734) See 6ed0d6224d64
author Kim Alvefur <zash@zash.se>
date Tue, 15 Jan 2019 20:08:30 +0100
parent 9449:94033a2529b9
child 9852:6ea3cafb6ac3
comparison
equal deleted inserted replaced
9783:4c91afc43639 9784:7fa273f8869e
593 function session.data(data) 593 function session.data(data)
594 data = filter("bytes/in", data); 594 data = filter("bytes/in", data);
595 if data then 595 if data then
596 local ok, err = stream:feed(data); 596 local ok, err = stream:feed(data);
597 if ok then return; end 597 if ok then return; end
598 log("warn", "Received invalid XML: %s", data); 598 log("debug", "Received invalid XML (%s) %d bytes: %q", tostring(err), #data, data:sub(1, 300));
599 log("warn", "Problem was: %s", err);
600 session:close("not-well-formed"); 599 session:close("not-well-formed");
601 end 600 end
602 end 601 end
603 602
604 session.close = session_close; 603 session.close = session_close;