httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Mon, 13 May 2002 06:45:08 GMT
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 */
  
  
  

Mime
View raw message