mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-21 00:35:49 +00:00
nfqws2: change retransmission detection scheme
This commit is contained in:
@@ -88,15 +88,11 @@ function standard_failure_detector(desync, crec, options)
|
||||
local trigger = false
|
||||
if desync.outgoing then
|
||||
if #desync.dis.payload>0 and options.retrans and (crec.retrans or 0)<options.retrans then
|
||||
if not crec.uppos then crec.uppos=0 end
|
||||
if desync.track.tcp.pos_orig<=crec.uppos then
|
||||
if is_retransmission(desync) then
|
||||
crec.retrans = crec.retrans and (crec.retrans+1) or 1
|
||||
DLOG("standard_failure_detector: retransmission "..crec.retrans.."/"..options.retrans)
|
||||
trigger = crec.retrans>=options.retrans
|
||||
end
|
||||
if desync.track.tcp.pos_orig>crec.uppos then
|
||||
crec.uppos=desync.track.tcp.pos_orig
|
||||
end
|
||||
end
|
||||
else
|
||||
if options.seq_rst and bitand(desync.dis.tcp.th_flags, TH_RST)~=0 then
|
||||
@@ -171,7 +167,6 @@ function circular(ctx, desync)
|
||||
|
||||
if not desync.dis.tcp then
|
||||
DLOG_ERR("circular: this orchestrator is tcp only. use filters to avoid udp traffic.")
|
||||
instance_cutoff(ctx)
|
||||
return
|
||||
end
|
||||
if not desync.track then
|
||||
|
||||
@@ -186,7 +186,7 @@ function desync_orchestrator_example(ctx, desync)
|
||||
end
|
||||
end
|
||||
|
||||
-- these function duplicate range check logic from C code
|
||||
-- these functions duplicate range check logic from C code
|
||||
-- mode must be n,d,b,s,x,a
|
||||
-- pos is {mode,pos}
|
||||
-- range is {from={mode,pos}, to={mode,pos}, upper_cutoff}
|
||||
@@ -238,7 +238,9 @@ end
|
||||
function pos_str(desync, pos)
|
||||
return pos.mode..pos_get(desync, pos.mode)
|
||||
end
|
||||
|
||||
function is_retransmission(desync)
|
||||
return desync.track and desync.track.tcp and 0==bitand(u32add(desync.track.tcp.uppos_orig_prev, -desync.track.tcp.pos_orig), 0x80000000)
|
||||
end
|
||||
|
||||
-- prepare standard rawsend options from desync
|
||||
-- repeats - how many time send the packet
|
||||
@@ -1328,4 +1330,3 @@ function ipfrag2(dis, ipfrag_options)
|
||||
|
||||
return {dis1,dis2}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user