aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/xmppclient_listener.lua3
-rw-r--r--net/xmppserver_listener.lua1
2 files changed, 3 insertions, 1 deletions
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua
index ce7788c7..dcc561f3 100644
--- a/net/xmppclient_listener.lua
+++ b/net/xmppclient_listener.lua
@@ -61,6 +61,7 @@ local function session_reset_stream(session)
function session.data(conn, data)
local ok, err = parser:parse(data);
if ok then return; end
+ log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "));
session:close("xml-not-well-formed");
end
@@ -100,7 +101,7 @@ local function session_close(session, reason)
end
session.send("</stream:stream>");
session.conn.close();
- xmppclient.disconnect(session.conn, (reason and reason.condition) or reason or "session closed");
+ xmppclient.disconnect(session.conn, (reason and (reason.text or reason.condition)) or reason or "session closed");
end
end
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index 81d26526..1f27d841 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -61,6 +61,7 @@ local function session_reset_stream(session)
function session.data(conn, data)
local ok, err = parser:parse(data);
if ok then return; end
+ log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "));
session:close("xml-not-well-formed");
end