Changeset

6404:938cc782c14d

core.sessionmanager: Set a fake thread on destroyed sessions, fixes traceback if stanzas are emitted after a session is destroyed (thanks Sven Blumenstein)
author Kim Alvefur <zash@zash.se>
date Thu, 11 Sep 2014 00:09:07 +0200
parents 6403:166d1bd8fc38
children 6405:61801dacc90b
files core/sessionmanager.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/sessionmanager.lua	Tue Sep 09 15:05:46 2014 +0200
+++ b/core/sessionmanager.lua	Thu Sep 11 00:09:07 2014 +0200
@@ -67,6 +67,7 @@
 
 	function session.send(data) log("debug", "Discarding data sent to resting session: %s", tostring(data)); return false; end
 	function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end
+	session.thread = { run = function (_, data) return session.data(data) end };
 	return setmetatable(session, resting_session);
 end