From 370e4a5e04ee7b29763f0666ed9028a128f0b9b1 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Wed, 15 May 2013 18:52:49 +0000 Subject: [PATCH] Avoid over allocation when dealing with the common case. As stated in the comment above : "We'll assume the common case where one bucket is enough". Doing so should save a few hundreds bytes in the 'request' pool when processing a request git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1483005 13f79535-47bb-0310-9956-ffa450edef68 --- server/protocol.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server/protocol.c b/server/protocol.c index e2f4d250cb..c542317343 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -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. @@ -290,9 +287,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) { -- 2.40.0