Comparison

plugins/mod_c2s.lua @ 6364:4e93e8768c36

mod_c2s, mod_s2s: Log received invalid stream headers
author Matthew Wild <mwild1@gmail.com>
date Sat, 23 Aug 2014 09:29:17 +0100
parent 6279:16d5b55c8d8d
child 6367:769a3577dd85
child 6380:4220ffb87b22
comparison
equal deleted inserted replaced
6363:ec446efc15e1 6364:4e93e8768c36
89 session:close(false); 89 session:close(false);
90 end 90 end
91 91
92 function stream_callbacks.error(session, error, data) 92 function stream_callbacks.error(session, error, data)
93 if error == "no-stream" then 93 if error == "no-stream" then
94 session.log("debug", "Invalid opening stream header"); 94 session.log("debug", "Invalid opening stream header (%s)", (data:gsub("^([^\1]+)\1", "{%1}")));
95 session:close("invalid-namespace"); 95 session:close("invalid-namespace");
96 elseif error == "parse-error" then 96 elseif error == "parse-error" then
97 (session.log or log)("debug", "Client XML parse error: %s", tostring(data)); 97 (session.log or log)("debug", "Client XML parse error: %s", tostring(data));
98 session:close("not-well-formed"); 98 session:close("not-well-formed");
99 elseif error == "stream-error" then 99 elseif error == "stream-error" then