1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

- 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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361298 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Gruno
2012-07-13 16:59:07 +00:00
parent 52510a70cf
commit f921f8cbde
2 changed files with 5 additions and 1 deletions

View File

@@ -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);