aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-01 12:58:37 +0200
committerKim Alvefur <zash@zash.se>2020-08-01 12:58:37 +0200
commita45a94ad3f2f7fbef2f361cbc25a4c5d8c256e05 (patch)
tree3205f1b5a0ef89f0ecad848511c61e81b5dda168
parente1cc07c773b16c6a376dda569f5cf0bfab0998a0 (diff)
downloadprosody-a45a94ad3f2f7fbef2f361cbc25a4c5d8c256e05.tar.gz
prosody-a45a94ad3f2f7fbef2f361cbc25a4c5d8c256e05.zip
mod_s2s: Escape invalid XML in loggin (same way as mod_c2s) fix #1574
-rw-r--r--plugins/mod_s2s/mod_s2s.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index aae37b7f..3f56b953 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -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