httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_deflate.c
Date Tue, 01 Jun 2004 13:06:10 GMT
jorton      2004/06/01 06:06:10

  Modified:    modules/filters mod_deflate.c
  Log:
  * modules/filters/mod_deflate.c (deflate_out_filter): Destroy buckets
  immediately after are used so that memory consumption is not
  proportional to the size of the response.
  
  PR: 29318
  
  Revision  Changes    Path
  1.49      +8 -4      httpd-2.0/modules/filters/mod_deflate.c
  
  Index: mod_deflate.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -d -u -r1.48 -r1.49
  --- mod_deflate.c	29 May 2004 03:34:17 -0000	1.48
  +++ mod_deflate.c	1 Jun 2004 13:06:10 -0000	1.49
  @@ -420,16 +420,15 @@
           ctx->stream.avail_out = c->bufferSize;
       }
       
  -    for (e = APR_BRIGADE_FIRST(bb);
  -         e != APR_BRIGADE_SENTINEL(bb);
  -         e = APR_BUCKET_NEXT(e))
  +    while (!APR_BRIGADE_EMPTY(bb))
       {
           const char *data;
           apr_bucket *b;
           apr_size_t len;
  -
           int done = 0;
   
  +        e = APR_BRIGADE_FIRST(bb);
  +
           if (APR_BUCKET_IS_EOS(e)) {
               char *buf;
               unsigned int deflate_len;
  @@ -516,6 +515,9 @@
           if (APR_BUCKET_IS_FLUSH(e)) {
               apr_bucket *bkt;
               apr_status_t rv;
  +
  +            apr_bucket_delete(e);
  +
               if (ctx->stream.avail_in > 0) {
                   zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
                   if (zRC != Z_OK) {
  @@ -575,6 +577,8 @@
               if (zRC != Z_OK)
                   return APR_EGENERAL;
           }
  +
  +        apr_bucket_delete(e);
       }
   
       apr_brigade_cleanup(bb);
  
  
  

Mime
View raw message