Update skynet.lua (#1415)

update skynet.ret
This commit is contained in:
zhuilang
2021-06-03 19:11:54 +08:00
committed by GitHub
parent 30b534b558
commit 219b15e9ec

View File

@@ -633,6 +633,9 @@ function skynet.ret(msg, sz)
local tag = session_coroutine_tracetag[running_thread]
if tag then c.trace(tag, "response") end
local co_session = session_coroutine_id[running_thread]
if co_session == nil then
error "No session"
end
session_coroutine_id[running_thread] = nil
if co_session == 0 then
if sz ~= nil then
@@ -641,9 +644,6 @@ function skynet.ret(msg, sz)
return false -- send don't need ret
end
local co_address = session_coroutine_address[running_thread]
if not co_session then
error "No session"
end
local ret = c.send(co_address, skynet.PTYPE_RESPONSE, co_session, msg, sz)
if ret then
return true