浏览代码

Fix Lua websocket stack overflow error

lua_pushlightuserdata() pushes a value onto the Lua stack, which has to be popped. Otherwise the stack fills up with every websocket timer callback.
k-mds 6 年之前
父节点
当前提交
01a0f4fa2d
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/mod_lua.inl

+ 1 - 0
src/mod_lua.inl

@@ -1778,6 +1778,7 @@ lua_action(struct laction_arg *arg)
 	lua_pushlightuserdata(arg->state, (void *)&lua_regkey_ctx);
 	lua_gettable(arg->state, LUA_REGISTRYINDEX);
 	ctx = (struct mg_context *)lua_touserdata(arg->state, -1);
+	lua_pop(arg->state, 1);
 
 	err = luaL_loadstring(arg->state, arg->txt);
 	if (err != 0) {