]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: cannot process more Lua hooks after a "done()" function call
authorThierry FOURNIER <tfournier@arpalert.org>
Fri, 28 Aug 2015 07:54:13 +0000 (09:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Aug 2015 08:12:49 +0000 (10:12 +0200)
When the Lua execution flow endswith the command done (core.done or txn.done())
an error is detourned, and the stack is no longer usable. This patch juste
reinitilize the stack if this case is detected.

src/hlua.c

index e98a28d1200276f47b1d37ee2d2b1bceeb326c5d..2def3d47f7e9d3571aab94613b9129bacba0f141 100644 (file)
@@ -1000,6 +1000,7 @@ timeout_reached:
                 */
                if (lua->flags & HLUA_EXIT) {
                        ret = HLUA_E_OK;
+                       hlua_ctx_renew(lua, 0);
                        break;
                }