From: André Malo Date: Tue, 25 May 2004 00:10:25 +0000 (+0000) Subject: allow LimitRequestBody to be reset to unlimited X-Git-Tag: pre_ajp_proxy~233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fb041d0ee9dde985a00141d4f351eceae89ce07;p=apache allow LimitRequestBody to be reset to unlimited PR: 29106 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103751 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ccf42ec70e..4be82e500e 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) Allow LimitRequestBody to be reset to unlimited. PR 29106 + [André Malo] + *) Fix a segfault when requests for shared memory fails and returns NULL. Fix a segfault caused by a lack of bounds checking on the cache. PR 24801 [Graham Leggett] diff --git a/server/core.c b/server/core.c index bbdd0eb137..3475c0f347 100644 --- a/server/core.c +++ b/server/core.c @@ -48,6 +48,10 @@ #include "mod_proxy.h" #include "ap_listen.h" +/* LimitRequestBody handling */ +#define AP_LIMIT_REQ_BODY_UNSET ((apr_off_t) -1) +#define AP_DEFAULT_LIMIT_REQ_BODY ((apr_off_t) 0) + /* LimitXMLRequestBody handling */ #define AP_LIMIT_UNSET ((long) -1) #define AP_DEFAULT_LIMIT_XML_BODY ((size_t)1000000) @@ -124,7 +128,7 @@ static void *create_core_dir_config(apr_pool_t *a, char *dir) conf->limit_nproc = NULL; #endif - conf->limit_req_body = 0; + conf->limit_req_body = AP_LIMIT_REQ_BODY_UNSET; conf->limit_xml_body = AP_LIMIT_UNSET; conf->sec_file = apr_array_make(a, 2, sizeof(ap_conf_vector_t *)); @@ -321,7 +325,7 @@ static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv) } #endif - if (new->limit_req_body) { + if (new->limit_req_body != AP_LIMIT_REQ_BODY_UNSET) { conf->limit_req_body = new->limit_req_body; } @@ -953,6 +957,10 @@ AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r) core_dir_config *d = (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); + if (d->limit_req_body == AP_LIMIT_REQ_BODY_UNSET) { + return AP_DEFAULT_LIMIT_REQ_BODY; + } + return d->limit_req_body; }