Changeset

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
parents 6363:ec446efc15e1
children 6365:75bd55e84112
files plugins/mod_c2s.lua plugins/mod_s2s/mod_s2s.lua
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Sat Aug 23 09:22:05 2014 +0100
+++ b/plugins/mod_c2s.lua	Sat Aug 23 09:29:17 2014 +0100
@@ -91,7 +91,7 @@
 
 function stream_callbacks.error(session, error, data)
 	if error == "no-stream" then
-		session.log("debug", "Invalid opening stream header");
+		session.log("debug", "Invalid opening stream header (%s)", (data:gsub("^([^\1]+)\1", "{%1}")));
 		session:close("invalid-namespace");
 	elseif error == "parse-error" then
 		(session.log or log)("debug", "Client XML parse error: %s", tostring(data));
--- a/plugins/mod_s2s/mod_s2s.lua	Sat Aug 23 09:22:05 2014 +0100
+++ b/plugins/mod_s2s/mod_s2s.lua	Sat Aug 23 09:29:17 2014 +0100
@@ -407,6 +407,7 @@
 
 function stream_callbacks.error(session, error, data)
 	if error == "no-stream" then
+		session.log("debug", "Invalid opening stream header (%s)", (data:gsub("^([^\1]+)\1", "{%1}")));
 		session:close("invalid-namespace");
 	elseif error == "parse-error" then
 		session.log("debug", "Server-to-server XML parse error: %s", tostring(error));