diff --git a/lua/zapret-auto.lua b/lua/zapret-auto.lua index a11f392..edab9ac 100644 --- a/lua/zapret-auto.lua +++ b/lua/zapret-auto.lua @@ -244,12 +244,11 @@ function circular(ctx, desync) end DLOG("circular: current strategy "..hrec.nstrategy) - local dcopy = desync_copy(desync) while true do local instance = plan_instance_pop(desync) if not instance then break end if instance.arg.strategy and tonumber(instance.arg.strategy)==hrec.nstrategy then - verdict = plan_instance_execute(dcopy, verdict, instance) + verdict = plan_instance_execute(desync, verdict, instance) end end diff --git a/lua/zapret-lib.lua b/lua/zapret-lib.lua index 9f3d929..922d5b0 100644 --- a/lua/zapret-lib.lua +++ b/lua/zapret-lib.lua @@ -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