httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1361298 - in /httpd/httpd/trunk/modules/lua: lua_request.c mod_lua.h
Date Fri, 13 Jul 2012 16:59:07 GMT
Author: humbedooh
Date: Fri Jul 13 16:59:07 2012
New Revision: 1361298

URL: http://svn.apache.org/viewvc?rev=1361298&view=rev
Log:
- Define LUA_COMPAT_ALL so mod_lua will be compatible with Lua 5.2
- Add an optional integer argument for parsebody, specifying the maximum size of POST that
will be accepted.

Modified:
    httpd/httpd/trunk/modules/lua/lua_request.c
    httpd/httpd/trunk/modules/lua/mod_lua.h

Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1361298&r1=1361297&r2=1361298&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Fri Jul 13 16:59:07 2012
@@ -171,11 +171,13 @@ static int req_parsebody(lua_State *L)
     apr_off_t len;
     int res;
     apr_size_t size;
+    apr_size_t max_post_size;
     char *buffer;
     request_rec *r = ap_lua_check_request_rec(L, 1);
+    max_post_size = (apr_size_t) luaL_optint(L, 2, MAX_STRING_LEN);
     lua_newtable(L);
     lua_newtable(L);            /* [table, table] */
-    res = ap_parse_form_data(r, NULL, &pairs, -1, MAX_STRING_LEN); /*XXX: Maybe increase
this value? */
+    res = ap_parse_form_data(r, NULL, &pairs, -1, max_post_size);
     if (res == OK) {
         while(pairs && !apr_is_empty_array(pairs)) {
             ap_form_pair_t *pair = (ap_form_pair_t *) apr_array_pop(pairs);

Modified: httpd/httpd/trunk/modules/lua/mod_lua.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.h?rev=1361298&r1=1361297&r2=1361298&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/mod_lua.h (original)
+++ httpd/httpd/trunk/modules/lua/mod_lua.h Fri Jul 13 16:59:07 2012
@@ -44,6 +44,8 @@
 #include "lauxlib.h"
 #include "lualib.h"
 
+/* Allow for Lua 5.2 backwards compatibility */
+#define LUA_COMPAT_ALL
 #if LUA_VERSION_NUM > 501
 /* Load mode for lua_load() */
 #define lua_load(a,b,c,d) lua_load(a,b,c,d,NULL)



Mime
View raw message