Comparison

plugins/mod_c2s.lua @ 7539:366964dbddb1

mod_c2s: Fix whitespace (why does it keep getting messed up?)
author Kim Alvefur <zash@zash.se>
date Sun, 07 Aug 2016 20:50:56 +0200
parent 7466:f28fa742def3
child 7540:e69df8093387
comparison
equal deleted inserted replaced
7538:a3a4ed0d34f4 7539:366964dbddb1
244 244
245 local filter = session.filter; 245 local filter = session.filter;
246 function session.data(data) 246 function session.data(data)
247 -- Parse the data, which will store stanzas in session.pending_stanzas 247 -- Parse the data, which will store stanzas in session.pending_stanzas
248 if data then 248 if data then
249 data = filter("bytes/in", data); 249 data = filter("bytes/in", data);
250 if data then 250 if data then
251 local ok, err = stream:feed(data); 251 local ok, err = stream:feed(data);
252 if not ok then 252 if not ok then
253 log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); 253 log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
254 session:close("not-well-formed"); 254 session:close("not-well-formed");
255 end 255 end
256 end 256 end