Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 93549 invoked by uid 500); 13 May 2002 06:45:09 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 93538 invoked by uid 500); 13 May 2002 06:45:09 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 13 May 2002 06:45:08 -0000 Message-ID: <20020513064508.70585.qmail@icarus.apache.org> From: brianp@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server protocol.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brianp 02/05/12 23:45:07 Modified: server protocol.c Log: Start with a larger buffer size in ap_rgetline_core() to avoid having to grow the buffer so often Revision Changes Path 1.103 +7 -1 httpd-2.0/server/protocol.c Index: protocol.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/protocol.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -r1.102 -r1.103 --- protocol.c 13 May 2002 06:16:31 -0000 1.102 +++ protocol.c 13 May 2002 06:45:07 -0000 1.103 @@ -217,6 +217,9 @@ 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. @@ -300,7 +303,10 @@ /* We'll assume the common case where one bucket is enough. */ if (!*s) { current_alloc = len; - *s = apr_palloc(r->pool, 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) { /* Increase the buffer size */