summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2013-09-02 13:43:53 +0200
committerEric Covener <covener@apache.org>2013-09-02 13:43:53 +0200
commitd7aa057282f5c1b6f5a66dfb3d8dcf603b3c1756 (patch)
tree1887d8257af9f0c1ba0fc0e5329dcba43735a9d1
parenttrace4 logging of return codes from LuaHook* functions. (diff)
downloadapache2-d7aa057282f5c1b6f5a66dfb3d8dcf603b3c1756.tar.xz
apache2-d7aa057282f5c1b6f5a66dfb3d8dcf603b3c1756.zip
Return a 500 error instead of DECLINED when LuaHook* script does not
return a numeric value. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519398 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--CHANGES3
-rw-r--r--modules/lua/mod_lua.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index d9a0d91d25..46e4fe86c7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_lua: Return a 500 error if a LuaHook* script doesn't return a
+ numeric return code. [Eric Covener]
+
*) Add experimental cmake-based build system for Windows. [Jeff Trawick,
Tom Donovan]
diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c
index 4d02a91a3d..4d5d762427 100644
--- a/modules/lua/mod_lua.c
+++ b/modules/lua/mod_lua.c
@@ -664,6 +664,11 @@ static int lua_request_rec_hook_harness(request_rec *r, const char *name, int ap
ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r, "Lua hook %s:%s for phase %s returned %d",
hook_spec->file_name, hook_spec->function_name, name, rc);
}
+ else {
+ ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r, "Lua hook %s:%s for phase %s did not return a numeric value",
+ hook_spec->file_name, hook_spec->function_name, name);
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
if (rc != DECLINED) {
ap_lua_release_state(L, spec, r);
return rc;