Project

General

Profile

Bug #2938 ยป lighttpd-mod_magnet-fix_wrong_return-type.diff

flynn, 2019-03-06 09:20

View differences:

src/mod_magnet.c 2019-03-06 10:16:59.639029275 +0100
/* we should have the function, the lighty table and the return value on the stack */
force_assert(lua_gettop(L) == 3);
lua_return_value = (int) luaL_optinteger(L, -1, -1);
{
int lua_return_type = lua_type(L, -1);
if (lua_return_type == LUA_TNUMBER || lua_return_type == LUA_TNIL) {
lua_return_value = (int) luaL_optinteger(L, -1, -1);
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
"lua_pcall():",
"unexpected return type:", lua_typename(L, lua_return_type));
lua_return_value = -1;
}
}
lua_pop(L, 1); /* pop return value */
magnet_copy_response_header(con, L, lighty_table_ndx);
    (1-1/1)