diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/s2smanager.lua | 3 | ||||
-rw-r--r-- | core/sessionmanager.lua | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua index aba99ee0..f2e95429 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -508,6 +508,8 @@ function mark_connected(session) end end +local function null_data_handler(data) log("debug", "Discarding data from destroyed s2s session: %s", data); end + function destroy_session(session, reason) (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)); @@ -523,6 +525,7 @@ function destroy_session(session, reason) session[k] = nil; end end + session.data = null_data_handler; end return _M; diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index a617d2ca..1d16b850 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -66,6 +66,8 @@ function new_session(conn) return session; end +local function null_data_handler(data) log("debug", "Discarding data from destroyed c2s session: %s", data); end + function destroy_session(session, err) (session.log or log)("info", "Destroying session for %s (%s@%s)", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)"); @@ -88,6 +90,7 @@ function destroy_session(session, err) session[k] = nil; end end + session.data = null_data_handler; end function make_authenticated(session, username) |