diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-07-26 20:58:37 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-07-26 20:58:37 +0100 |
commit | 423921e9dd7d815f76bc490eeb1eed7bcf8b4816 (patch) | |
tree | 78bfd26f41765020f1732bb1e0200b941c7f9c44 /net | |
parent | 9a0d700321b59342c902f45d4aec76772c0f7f95 (diff) | |
download | prosody-423921e9dd7d815f76bc490eeb1eed7bcf8b4816.tar.gz prosody-423921e9dd7d815f76bc490eeb1eed7bcf8b4816.zip |
xmpp{client,server}_listener: Report contents of packets containing invalid XML
Diffstat (limited to 'net')
-rw-r--r-- | net/xmppclient_listener.lua | 1 | ||||
-rw-r--r-- | net/xmppserver_listener.lua | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua index cc65ff75..e882546f 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 diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua index 3cfcfe86..2e70145d 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 |