Comparison

plugins/mod_component.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 9562:acf74ad0b795
child 9870:8f4880576835
comparison
equal deleted inserted replaced
9783:4c91afc43639 9784:7fa273f8869e
308 end 308 end
309 309
310 function session.data(_, data) 310 function session.data(_, data)
311 local ok, err = stream:feed(data); 311 local ok, err = stream:feed(data);
312 if ok then return; end 312 if ok then return; end
313 module:log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); 313 log("debug", "Received invalid XML (%s) %d bytes: %q", tostring(err), #data, data:sub(1, 300));
314 session:close("not-well-formed"); 314 session:close("not-well-formed");
315 end 315 end
316 316
317 session.dispatch_stanza = stream_callbacks.handlestanza; 317 session.dispatch_stanza = stream_callbacks.handlestanza;
318 318