66 self:add_plugin("session"); |
66 self:add_plugin("session"); |
67 |
67 |
68 function self.data(conn, data) |
68 function self.data(conn, data) |
69 local ok, err = self.stream:feed(data); |
69 local ok, err = self.stream:feed(data); |
70 if ok then return; end |
70 if ok then return; end |
71 stream:debug("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); |
71 self:debug("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); |
72 stream:close("xml-not-well-formed"); |
72 self:close("xml-not-well-formed"); |
73 end |
73 end |
74 |
74 |
75 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); |
75 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); |
76 |
76 |
77 self.curr_id = 0; |
77 self.curr_id = 0; |