aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-12 17:14:54 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-12 17:14:54 +0000
commita76e149c1ccbaa797e59754a39382d375a6a5070 (patch)
tree96313b17d1c5af47c62da95131c910c18f7aaaed /core/sessionmanager.lua
parentd6548d9810aef37d92fac4f51fbe47882407e6d4 (diff)
downloadprosody-a76e149c1ccbaa797e59754a39382d375a6a5070.tar.gz
prosody-a76e149c1ccbaa797e59754a39382d375a6a5070.zip
sessionmanager, s2smanager: Give sessions dummy data handlers that log when data is received by a destroyed session
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua3
1 files changed, 3 insertions, 0 deletions
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)