-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_lua: Allow scripts handled by the lua-script handler to return
+ a status code to the client (such as a 302 or a 500) [Daniel Gruno]
+
*) mod_proxy_ajp: Fix crash in packet dump code when logging
with LogLevel trace7 or trace8. PR 53730. [Rainer Jung]
*/
static int lua_handler(request_rec *r)
{
+ int rc = OK;
if (strcmp(r->handler, "lua-script")) {
return DECLINED;
}
return HTTP_INTERNAL_SERVER_ERROR;
}
ap_lua_run_lua_request(L, r);
- if (lua_pcall(L, 1, 0, 0)) {
+ if (lua_pcall(L, 1, 1, 0)) {
report_lua_error(L, r);
}
+ if (lua_isnumber(L, -1)) {
+ rc = lua_tointeger(L, -1);
+ }
ap_lua_release_state(L, spec, r);
}
- return OK;
+ return rc;
}