Software /
code /
prosody
Comparison
plugins/mod_c2s.lua @ 6382:57d23c26039b
Merge 0.9->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 02 Sep 2014 22:33:11 +0200 |
parent | 6367:769a3577dd85 |
parent | 6380:4220ffb87b22 |
child | 6630:6735e2d735d6 |
comparison
equal
deleted
inserted
replaced
6377:50e5aed4eeea | 6382:57d23c26039b |
---|---|
238 | 238 |
239 local filter = session.filter; | 239 local filter = session.filter; |
240 function session.data(data) | 240 function session.data(data) |
241 -- Parse the data, which will store stanzas in session.pending_stanzas | 241 -- Parse the data, which will store stanzas in session.pending_stanzas |
242 if data then | 242 if data then |
243 data = filter("bytes/in", data); | 243 data = filter("bytes/in", data); |
244 if data then | 244 if data then |
245 local ok, err = stream:feed(data); | 245 local ok, err = stream:feed(data); |
246 if not ok then | 246 if not ok then |
247 log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); | 247 log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); |
248 session:close("not-well-formed"); | 248 session:close("not-well-formed"); |
249 end | 249 end |
250 end | 250 end |