mod_s2s: Escape invalid XML in loggin (same way as mod_c2s) fix #1574

This commit is contained in:
Kim Alvefur 2020-08-01 12:58:37 +02:00
parent 348d2a8e1c
commit 302dfe821e

View file

@ -595,8 +595,7 @@ local function initialize_session(session)
if data then
local ok, err = stream:feed(data);
if ok then return; end
log("warn", "Received invalid XML: %s", data);
log("warn", "Problem was: %s", err);
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("not-well-formed");
end
end