From a43dd91645fe28624efc5bb41886fdae0bf1cfcb Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Thu, 6 Jun 2013 01:04:17 +0000 Subject: [PATCH] tolerate LuaMapHandler scripts that don't return anything git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1490098 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/lua/mod_lua.c | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index f2510d2bdc..45bb17aad9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_lua: If a LuaMapHandler doesn't return any value, log a warning + and treat it as apache2.OK. [Eric Covener] + *) ab: Add a new -l parameter in order not to check the length of the responses. This can be usefull with dynamic pages. PR9945, PR27888, PR42040 [] diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index d9ab79de71..7c35011ec1 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -750,11 +750,17 @@ static int lua_map_handler(request_rec *r) if (lua_isnumber(L, -1)) { rc = lua_tointeger(L, -1); } - if (rc != DECLINED) { - ap_lua_release_state(L, spec, r); - return rc; + else { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(02483) + "lua: Lua handler %s in %s did not return a value, assuming apache2.OK", + function_name, + filename); + rc = OK; } ap_lua_release_state(L, spec, r); + if (rc != DECLINED) { + return rc; + } } } return DECLINED;