mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
Add a rare case
This commit is contained in:
@@ -107,18 +107,23 @@ do ---- avoid session rewind conflict
|
|||||||
reset_dangerzone(session)
|
reset_dangerzone(session)
|
||||||
assert(next_session > dangerzone_up)
|
assert(next_session > dangerzone_up)
|
||||||
set_checkrewind()
|
set_checkrewind()
|
||||||
return
|
else
|
||||||
|
while true do
|
||||||
|
if not dangerzone[next_session] then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if not session_id_coroutine[next_session] then
|
||||||
|
reset_dangerzone(session)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
-- skip the session already exist.
|
||||||
|
next_session = c.genid() + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
while true do
|
-- session will rewind after 0x7fffffff
|
||||||
if not dangerzone[next_session] then
|
if next_session == 0x80000000 and dangerzone[1] then
|
||||||
return
|
assert(c.genid() == 1)
|
||||||
end
|
return checkconflict(1)
|
||||||
if not session_id_coroutine[next_session] then
|
|
||||||
reset_dangerzone(session)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- skip the session already exist.
|
|
||||||
next_session = c.genid() + 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -136,7 +141,7 @@ do ---- avoid session rewind conflict
|
|||||||
|
|
||||||
local function auxsend_checkrewind(addr, proto, msg, sz)
|
local function auxsend_checkrewind(addr, proto, msg, sz)
|
||||||
local session = csend(addr, proto, nil, msg, sz)
|
local session = csend(addr, proto, nil, msg, sz)
|
||||||
if session and session > dangerzone_low and session < dangerzone_up then
|
if session and session > dangerzone_low and session <= dangerzone_up then
|
||||||
-- enter dangerzone
|
-- enter dangerzone
|
||||||
set_checkconflict(session)
|
set_checkconflict(session)
|
||||||
end
|
end
|
||||||
@@ -145,7 +150,7 @@ do ---- avoid session rewind conflict
|
|||||||
|
|
||||||
local function auxtimeout_checkrewind(timeout)
|
local function auxtimeout_checkrewind(timeout)
|
||||||
local session = cintcommand("TIMEOUT", timeout)
|
local session = cintcommand("TIMEOUT", timeout)
|
||||||
if session and session > dangerzone_low and session < dangerzone_up then
|
if session and session > dangerzone_low and session <= dangerzone_up then
|
||||||
-- enter dangerzone
|
-- enter dangerzone
|
||||||
set_checkconflict(session)
|
set_checkconflict(session)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user