Software /
code /
prosody
Comparison
net/xmppserver_listener.lua @ 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 |
parent | 1955:a9a8ef70d14c |
child | 2052:161db352822c |
comparison
equal
deleted
inserted
replaced
1977:325a49f8edab | 1978:8f9dc8a25660 |
---|---|
59 session.notopen = true; | 59 session.notopen = true; |
60 | 60 |
61 function session.data(conn, data) | 61 function session.data(conn, data) |
62 local ok, err = parser:parse(data); | 62 local ok, err = parser:parse(data); |
63 if ok then return; end | 63 if ok then return; end |
64 session.log("warn", "Received invalid XML: %s", data); | 64 (log or session.log)("warn", "Received invalid XML: %s", data); |
65 session.log("warn", "Problem was: %s", err); | 65 (log or session.log)("warn", "Problem was: %s", err); |
66 session:close("xml-not-well-formed"); | 66 session:close("xml-not-well-formed"); |
67 end | 67 end |
68 | 68 |
69 return true; | 69 return true; |
70 end | 70 end |