Explorar o código

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 %!s(int64=6) %!d(string=hai) anos
pai
achega
01a0f4fa2d
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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) {