Software /
code /
verse
Comparison
component.lua @ 400:0db9cb909cf1
client, component: Fix logging of invalid XML
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 09 Feb 2016 23:39:31 +0000 |
parent | 314:ee5fc3ee9150 |
child | 410:6171ef2a4025 |
comparison
equal
deleted
inserted
replaced
399:82ad158714e5 | 400:0db9cb909cf1 |
---|---|
57 self.username, self.host, self.resource = jid_split(jid); | 57 self.username, self.host, self.resource = jid_split(jid); |
58 | 58 |
59 function self.data(conn, data) | 59 function self.data(conn, data) |
60 local ok, err = self.stream:feed(data); | 60 local ok, err = self.stream:feed(data); |
61 if ok then return; end | 61 if ok then return; end |
62 stream:debug("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); | 62 stream:debug("Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); |
63 stream:close("xml-not-well-formed"); | 63 stream:close("xml-not-well-formed"); |
64 end | 64 end |
65 | 65 |
66 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); | 66 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); |
67 | 67 |