mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
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.
This commit is contained in:
parent
26eb5ea352
commit
e48d1dc2d9
@ -7482,6 +7482,9 @@ __LJMP static int hlua_txn_done(lua_State *L)
|
|||||||
if (!(s->flags & SF_FINST_MASK))
|
if (!(s->flags & SF_FINST_MASK))
|
||||||
s->flags |= finst;
|
s->flags |= finst;
|
||||||
|
|
||||||
|
if ((htxn->flags & HLUA_TXN_CTX_MASK) == HLUA_TXN_FLT_CTX)
|
||||||
|
lua_pushinteger(L, -1);
|
||||||
|
else
|
||||||
lua_pushinteger(L, ACT_RET_ABRT);
|
lua_pushinteger(L, ACT_RET_ABRT);
|
||||||
WILL_LJMP(hlua_done(L));
|
WILL_LJMP(hlua_done(L));
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user