You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fu...@apache.org on 2013/04/14 04:36:23 UTC
svn commit: r1467718 - /httpd/httpd/trunk/modules/lua/lua_request.c
Author: fuankg
Date: Sun Apr 14 02:36:23 2013
New Revision: 1467718
URL: http://svn.apache.org/r1467718
Log:
Decouple mod_lua max regex matches from AP_MAX_REG_MATCH.
Bumped the default to 25 matches; this default can be
overwritten with a CLFAGS define.
Modified:
httpd/httpd/trunk/modules/lua/lua_request.c
Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1467718&r1=1467717&r2=1467718&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Sun Apr 14 02:36:23 2013
@@ -25,6 +25,10 @@
APLOG_USE_MODULE(lua);
#define POST_MAX_VARS 500
+#ifndef MODLUA_MAX_REG_MATCH
+#define MODLUA_MAX_REG_MATCH 25
+#endif
+
typedef char *(*req_field_string_f) (request_rec * r);
typedef int (*req_field_int_f) (request_rec * r);
typedef apr_table_t *(*req_field_apr_table_f) (request_rec * r);
@@ -898,7 +902,7 @@ static int lua_ap_regex(lua_State *L)
*source;
char *err;
ap_regex_t regex;
- ap_regmatch_t matches[AP_MAX_REG_MATCH+1];
+ ap_regmatch_t matches[MODLUA_MAX_REG_MATCH+1];
luaL_checktype(L, 1, LUA_TUSERDATA);
luaL_checktype(L, 2, LUA_TSTRING);
@@ -917,7 +921,7 @@ static int lua_ap_regex(lua_State *L)
return 2;
}
- rv = ap_regexec(®ex, source, AP_MAX_REG_MATCH, matches, 0);
+ rv = ap_regexec(®ex, source, MODLUA_MAX_REG_MATCH, matches, 0);
if (rv == AP_REG_NOMATCH) {
lua_pushboolean(L, 0);
return 1;