aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.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/s2smanager.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/s2smanager.lua')
-rw-r--r--core/s2smanager.lua3
1 files changed, 3 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;