core.sessionmanager: Add a dummy rawsend() method to resting sessions

Should fix a traceback on attempted use after destruction, in case where
opportunistic_writes was in use.

Thanks Ge0rG
This commit is contained in:
Kim Alvefur 2021-04-15 15:12:35 +02:00
parent 21fa25b27b
commit 1e3a250929

View file

@ -86,6 +86,7 @@ local function retire_session(session)
end
function session.send(data) log("debug", "Discarding data sent to resting session: %s", data); return false; end
function session.rawsend(data) log("debug", "Discarding data sent to resting session: %s", data); return false; end
function session.data(data) log("debug", "Discarding data received from resting session: %s", data); end
session.thread = { run = function (_, data) return session.data(data) end };
return setmetatable(session, resting_session);