]> granicus.if.org Git - apache/commitdiff
Return a 500 error instead of DECLINED when LuaHook* script does not
authorEric Covener <covener@apache.org>
Mon, 2 Sep 2013 11:43:53 +0000 (11:43 +0000)
committerEric Covener <covener@apache.org>
Mon, 2 Sep 2013 11:43:53 +0000 (11:43 +0000)
return a numeric value.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519398 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/lua/mod_lua.c

diff --git a/CHANGES b/CHANGES
index d9a0d91d25c2f7e2b8312df3ef60c339d3bb63ca..46e4fe86c764e0e4a4f2b2fb342a5e7f9edfb8a5 100644 (file)
--- 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]
 
index 4d02a91a3d2c2f424eeb7083879e20d37bd3e1b3..4d5d76242725202d9cc48251b0a3210e3135b622 100644 (file)
@@ -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;