Software /
code /
prosody
Changeset
2167:e41a6ea7fc0f
xmppclient_listener: Escape control characters when logging invalid XML.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 24 Nov 2009 22:42:08 +0500 |
parents | 2154:b8635ebd7f57 |
children | 2168:1a99a3bf3ce6 |
files | net/xmppclient_listener.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/net/xmppclient_listener.lua Mon Nov 23 21:46:37 2009 +0500 +++ b/net/xmppclient_listener.lua Tue Nov 24 22:42:08 2009 +0500 @@ -61,7 +61,7 @@ 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]+", " ")); + log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); session:close("xml-not-well-formed"); end