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

zapret-lib,zapret-auto: do not use desync copy to not lose VERDICT_MODIFY changes

This commit is contained in:
bol-van
2025-12-10 13:43:39 +03:00
parent 5c05c10f83
commit 33ac18ea6b
2 changed files with 6 additions and 5 deletions

View File

@@ -143,6 +143,9 @@ function apply_arg_prefix(desync)
end
end
-- copy instance identification and args from execution plan to desync table
-- NOTE : to not lose VERDICT_MODIFY dissect changes pass original desync table
-- NOTE : if a copy was passed and VERDICT_MODIFY returned you must copy modified dissect back to desync table or resend it and return VERDICT_DROP
-- NOTE : args and some fields are substituted. if you need them - make a copy before calling this.
function apply_execution_plan(desync, instance)
desync.func = instance.func
desync.func_n = instance.func_n
@@ -206,12 +209,11 @@ function desync_copy(desync)
end
-- redo what whould be done without orchestration
function replay_execution_plan(desync)
local dcopy = desync_copy(desync)
local verdict = VERDICT_PASS
while true do
local instance = plan_instance_pop(dcopy)
local instance = plan_instance_pop(desync)
if not instance then break end
verdict = plan_instance_execute(dcopy, verdict, instance)
verdict = plan_instance_execute(desync, verdict, instance)
end
return verdict
end