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:16:32 GMT
brianp      02/05/12 23:16:32

  Modified:    server   protocol.c
  Log:
  Optimization: modified the power-of-two allocator in ap_rgetline_core()
  so that it converges on the new buffer size in a single iteration.
  
  Revision  Changes    Path
  1.102     +5 -5      httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- protocol.c	12 May 2002 16:55:41 -0000	1.101
  +++ protocol.c	13 May 2002 06:16:31 -0000	1.102
  @@ -303,13 +303,13 @@
                   *s = apr_palloc(r->pool, len);
               }
               else if (bytes_handled + len > current_alloc) {
  -                /* We resize to the next power of 2. */
  -                apr_size_t new_size = current_alloc;
  +                /* Increase the buffer size */
  +                apr_size_t new_size = current_alloc * 2;
                   char *new_buffer;
   
  -                do {
  -                    new_size *= 2;
  -                } while (bytes_handled + len > new_size);
  +                if (bytes_handled + len > new_size) {
  +                    new_size = (bytes_handled + len) * 2;
  +                }
   
                   new_buffer = apr_palloc(r->pool, new_size);
   
  
  
  

Mime
View raw message