]> granicus.if.org Git - apache/commitdiff
core: Do not over allocate memory within 'ap_rgetline_core' for the common case.
authorGraham Leggett <minfrin@apache.org>
Thu, 23 May 2013 14:28:41 +0000 (14:28 +0000)
committerGraham Leggett <minfrin@apache.org>
Thu, 23 May 2013 14:28:41 +0000 (14:28 +0000)
trunk patch: http://svn.apache.org/r1483005
Submitted by: jailletc36
Reviewed by: jim, minfrin

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

CHANGES
STATUS
server/protocol.c

diff --git a/CHANGES b/CHANGES
index 6dbdee954c17c56bd741517397a783f0aade4c56..e641bad1e3496f9dd03f33ba7dfcaf4cbd1f86b5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.5
 
+  *) core: Do not over allocate memory within 'ap_rgetline_core' for
+     the common case. [Christophe Jaillet]
+
   *) core: speed up (for common cases) and reduce memory usage of
      ap_escape_logitem(). This should save 70-100 bytes in the request
      pool for a default config. [Christophe Jaillet]
diff --git a/STATUS b/STATUS
index f8963546ae1fb62d74f82a59a4f15f2db046ba74..7ca478c74cd4efb39ae0e77434d6fa66c64ead9a 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -90,11 +90,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * core: Do not over allocate memory within 'ap_rgetline_core' for the common case.
-      trunk patch: http://svn.apache.org/r1483005
-      2.4.x patch: trunk works
-      +1: jailletc36, jim, minfrin
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index c2b1f48cd865c2472f2f85f555a685e58e7564d0..a0b3246427e098b65a57ba801d7ece4e0426292c 100644 (file)
@@ -185,9 +185,6 @@ AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime)
     return (mtime > now) ? now : mtime;
 }
 
-/* Min # of bytes to allocate when reading a request line */
-#define MIN_LINE_ALLOC 80
-
 /* Get a line of protocol input, including any continuation lines
  * caused by MIME folding (or broken clients) if fold != 0, and place it
  * in the buffer s, of size n bytes, without the ending newline.
@@ -286,9 +283,6 @@ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n,
                 /* We'll assume the common case where one bucket is enough. */
                 if (!*s) {
                     current_alloc = len;
-                    if (current_alloc < MIN_LINE_ALLOC) {
-                        current_alloc = MIN_LINE_ALLOC;
-                    }
                     *s = apr_palloc(r->pool, current_alloc);
                 }
                 else if (bytes_handled + len > current_alloc) {