]> granicus.if.org Git - apache/commitdiff
allow LimitRequestBody to be reset to unlimited
authorAndré Malo <nd@apache.org>
Tue, 25 May 2004 00:10:25 +0000 (00:10 +0000)
committerAndré Malo <nd@apache.org>
Tue, 25 May 2004 00:10:25 +0000 (00:10 +0000)
PR: 29106

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103751 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/core.c

diff --git a/CHANGES b/CHANGES
index ccf42ec70e1614632766abbad062ece66deb4a06..4be82e500e1750a1180975547c1c4c9909b3fd77 100644 (file)
--- 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]
index bbdd0eb137bff3af4056bd6e05cda8fa05ffc790..3475c0f347beac5bf3f32577617de6116f13fb4b 100644 (file)
 #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;
 }