BUG/MINOR: lua/filters: Return right code when txn:done() is called
txn functions can now be called from an action or a filter context. Thus the
return code must be adapted depending on this context. From an action, act.ABORT
is returned. From a filter, -1 is returned. It is the filter error code.
This bug only affects 2.5-dev. No backport needed.
diff --git a/src/hlua.c b/src/hlua.c
index 7e68d0b..7eec25c 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -7482,7 +7482,10 @@
if (!(s->flags & SF_FINST_MASK))
s->flags |= finst;
- lua_pushinteger(L, ACT_RET_ABRT);
+ if ((htxn->flags & HLUA_TXN_CTX_MASK) == HLUA_TXN_FLT_CTX)
+ lua_pushinteger(L, -1);
+ else
+ lua_pushinteger(L, ACT_RET_ABRT);
WILL_LJMP(hlua_done(L));
return 0;
}