Software /
code /
prosody
Diff
core/s2smanager.lua @ 2857:6036c4b75235
sessionmanager, s2smanager: Give sessions dummy data handlers that log when data is received by a destroyed session
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 12 Feb 2010 17:14:54 +0000 |
parent | 2712:9c579864b20a |
child | 2858:d08771a2f617 |
line wrap: on
line diff
--- a/core/s2smanager.lua Fri Feb 12 15:05:48 2010 +0000 +++ b/core/s2smanager.lua Fri Feb 12 17:14:54 2010 +0000 @@ -491,6 +491,8 @@ end end +local function null_data_handler(data) log("debug", "Discarding data from destroyed s2s session: %s", data); end + function destroy_session(session) (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)); @@ -506,6 +508,7 @@ session[k] = nil; end end + session.data = null_data_handler; end return _M;