Comparison

core/s2smanager.lua @ 7452:d916703d5e18

s2smanager: Include a stub thread on destroyed sessions (thanks Link Mauve)
author Kim Alvefur <zash@zash.se>
date Thu, 09 Jun 2016 14:04:50 +0200
parent 6779:6236668da30a
child 7950:f91e7ec9654e
comparison
equal deleted inserted replaced
7451:464a8a8de625 7452:d916703d5e18
62 62
63 session.destruction_reason = reason; 63 session.destruction_reason = reason;
64 64
65 function session.send(data) log("debug", "Discarding data sent to resting session: %s", tostring(data)); end 65 function session.send(data) log("debug", "Discarding data sent to resting session: %s", tostring(data)); end
66 function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end 66 function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end
67 session.thread = { run = function (_, data) return session.data(data) end };
67 session.sends2s = session.send; 68 session.sends2s = session.send;
68 return setmetatable(session, resting_session); 69 return setmetatable(session, resting_session);
69 end 70 end
70 71
71 local function destroy_session(session, reason) 72 local function destroy_session(session, reason)