]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Allow LimitRequestBody to be reset to unlimited.
authorAndré Malo <nd@apache.org>
Sun, 6 Jun 2004 13:23:26 +0000 (13:23 +0000)
committerAndré Malo <nd@apache.org>
Sun, 6 Jun 2004 13:23:26 +0000 (13:23 +0000)
PR: 29106
Reviewed by: Jeff Trawick, Brad Nicholes, Astrid Ke�ler

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

CHANGES
STATUS
server/core.c

diff --git a/CHANGES b/CHANGES
index 6c89996e762f98082581a525b1d0f77de90fc884..e5edbb3ff9fb57619904630fbe3629ad558b19d1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.50
 
+  *) Allow LimitRequestBody to be reset to unlimited. PR 29106
+     [André Malo]
+
   *) Fix a bunch of cases where the return code of the regex compiler
      was not checked properly. This affects: mod_setenvif, mod_usertrack,
      mod_proxy, mod_proxy_ftp and core. PR 28218.  [André Malo]
diff --git a/STATUS b/STATUS
index 272cdd46248bb7cf7aefe59dd45eb1d397e95a4e..9fdd1973eb1fa7bc1b5b654c17f2c38132b86235 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/06/06 12:55:44 $]
+Last modified at [$Date: 2004/06/06 13:23:26 $]
 
 Release:
 
@@ -102,11 +102,6 @@ PATCHES TO BACKPORT FROM 2.1
        docs/manual/mod/mod_ldap.xml r1.12
        +1 minfrin, bnicholes
 
-    *) Allow LimitRequestBody to be reset to unlimited. PR 29106
-         server/core.c: r1.279
-       +1: nd, trawick, bnicholes
-       +1: kess (on concept)
-
     *) Small fix to allow reverse proxying to an ftp server. Previously
        an attempt to do this would try and connect to 0.0.0.0, regardless
        of the server specified.
index 409e7b188f3810c2e9c183567ebf9c8be0742a7c..290c99fc3f31d5af237c2227ed3adb5d138ceff0 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)
@@ -114,7 +118,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 *));
 
@@ -315,7 +319,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;
     }
 
@@ -943,6 +947,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;
 }