File

util/xpcall.lua @ 11417:f84005d06663

mod_s2s: Check direction in bidi-aware style Both session.incoming and session.outgoing are truthy here, but session.direction indicates the "real" direction in the way that matters for the order of events when opening or closing streams.
author Kim Alvefur <zash@zash.se>
date Wed, 03 Mar 2021 13:26:38 +0100
parent 9561:cfc7b2f7251e
child 12975:d10957394a3c
line wrap: on
line source

local xpcall = xpcall;

if select(2, xpcall(function (x) return x end, function () end,  "test")) ~= "test" then
	xpcall = require"util.compat".xpcall;
end

return {
	xpcall = xpcall;
};