Add a rare case

This commit is contained in:
Cloud Wu
2023-09-28 20:15:29 +08:00
parent f3f7e725e8
commit 5ec02a4a2c

View File

@@ -107,20 +107,25 @@ 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
end
while true do while true do
if not dangerzone[next_session] then if not dangerzone[next_session] then
return break
end end
if not session_id_coroutine[next_session] then if not session_id_coroutine[next_session] then
reset_dangerzone(session) reset_dangerzone(session)
return break
end end
-- skip the session already exist. -- skip the session already exist.
next_session = c.genid() + 1 next_session = c.genid() + 1
end end
end end
-- session will rewind after 0x7fffffff
if next_session == 0x80000000 and dangerzone[1] then
assert(c.genid() == 1)
return checkconflict(1)
end
end
local function auxsend_checkconflict(addr, proto, msg, sz) local function auxsend_checkconflict(addr, proto, msg, sz)
local session = csend(addr, proto, nil, msg, sz) local session = csend(addr, proto, nil, msg, sz)
@@ -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