Software /
code /
prosody
Changeset
1978:8f9dc8a25660
xmppserver_listener: Use listener log() if session doesn't have one yet (thanks Flo)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 17 Oct 2009 15:34:21 +0100 |
parents | 1977:325a49f8edab |
children | 1979:52ddaa2e6ab8 |
files | net/xmppserver_listener.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/net/xmppserver_listener.lua Sat Oct 17 15:26:32 2009 +0100 +++ b/net/xmppserver_listener.lua Sat Oct 17 15:34:21 2009 +0100 @@ -61,8 +61,8 @@ function session.data(conn, data) local ok, err = parser:parse(data); if ok then return; end - session.log("warn", "Received invalid XML: %s", data); - session.log("warn", "Problem was: %s", err); + (log or session.log)("warn", "Received invalid XML: %s", data); + (log or session.log)("warn", "Problem was: %s", err); session:close("xml-not-well-formed"); end