Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCB22C607 for ; Fri, 13 Jul 2012 16:59:28 +0000 (UTC) Received: (qmail 87100 invoked by uid 500); 13 Jul 2012 16:59:28 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 87028 invoked by uid 500); 13 Jul 2012 16:59:28 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 87021 invoked by uid 99); 13 Jul 2012 16:59:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 16:59:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 16:59:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C358923889E1; Fri, 13 Jul 2012 16:59:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1361298 - in /httpd/httpd/trunk/modules/lua: lua_request.c mod_lua.h Date: Fri, 13 Jul 2012 16:59:07 -0000 To: cvs@httpd.apache.org From: humbedooh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120713165907.C358923889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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)