]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: don't reset undesired flags in hlua_ctx_resume
authorThierry FOURNIER <tfournier@arpalert.org>
Sun, 27 Sep 2015 23:02:01 +0000 (01:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 27 Sep 2015 23:03:43 +0000 (01:03 +0200)
Some flags like HLUA_MUST_GC must not be cleared otherwise sessions are
not properly cleaned.

src/hlua.c

index d205a38798cbf1487c336283ad8e1e802bec22b7..2682129b58481f05073a42170ec3e8bb968e9315 100644 (file)
@@ -1034,8 +1034,6 @@ static enum hlua_exec hlua_ctx_resume(struct hlua *lua, int yield_allowed)
        int ret;
        const char *msg;
 
-       HLUA_SET_RUN(lua);
-
        /* If we want to resume the task, then check first the execution timeout.
         * if it is reached, we can interrupt the Lua processing.
         */
@@ -1050,7 +1048,10 @@ resume_execution:
        lua_sethook(lua->T, hlua_hook, LUA_MASKCOUNT, hlua_nb_instruction);
 
        /* Remove all flags except the running flags. */
-       lua->flags = HLUA_RUN;
+       HLUA_SET_RUN(lua);
+       HLUA_CLR_CTRLYIELD(lua);
+       HLUA_CLR_WAKERESWR(lua);
+       HLUA_CLR_WAKEREQWR(lua);
 
        /* Call the function. */
        ret = lua_resume(lua->T, gL.T, lua->nargs);