Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

zapret-auto: override host autostate key

This commit is contained in:
bol-van
2025-12-11 12:57:32 +03:00
parent a6d43af931
commit 6ce5829d06
2 changed files with 12 additions and 5 deletions

View File

@@ -88,3 +88,4 @@ v0.7
* nfqws2: autohostlist: trigger RST and http redirect failures only within specified relative sequence
* nfqws2: autohostlist: trigger http redirect failure if payload is http_req without connection proto check
* nfqws2: push desync.track.pos.dt as float with nsec accuracy
* zapret-auto: override host autostate key in automate_host_record

View File

@@ -4,9 +4,12 @@
-- failure detectors test potential block conditions for orchestrators
-- arg: reqhost - require hostname, do not work with ip
-- arg: key - a string - table name inside autostate table. to allow multiple orchestrator instances to use single host storage
function automate_host_record(desync)
local key
if desync.arg.reqhost then
if desync.arg.key and #desync.arg.key>0 then
key = desync.arg.key
elseif desync.arg.reqhost then
key = desync.track and desync.track.hostname
else
key = host_or_ip(desync)
@@ -15,14 +18,17 @@ function automate_host_record(desync)
DLOG("automate: host record key unavailable")
return nil
end
DLOG("automate: host record key '"..key.."'")
DLOG("automate: host record key 'autostate."..desync.func_instance.."."..key.."'")
if not autostate then
autostate = {}
end
if not autostate[key] then
autostate[key] = {}
if not autostate[desync.func_instance] then
autostate[desync.func_instance] = {}
end
return autostate[key]
if not autostate[desync.func_instance][key] then
autostate[desync.func_instance][key] = {}
end
return autostate[desync.func_instance][key]
end
function automate_conn_record(desync)
if not desync.track.lua_state.automate then