httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_deflate.c
Date Fri, 14 Jun 2002 07:58:34 GMT
jerenkrantz    2002/06/14 00:58:34

  Modified:    modules/filters mod_deflate.c
  Log:
  Modify the deflate input filter so that it should always return data on a
  blocking read.
  
  Revision  Changes    Path
  1.19      +19 -0     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_deflate.c	12 Jun 2002 07:40:54 -0000	1.18
  +++ mod_deflate.c	14 Jun 2002 07:58:34 -0000	1.19
  @@ -720,8 +720,27 @@
                   APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, eos); 
                   break;
               }
  +
           }
           apr_brigade_cleanup(ctx->bb);
  +    }
  +
  +    /* If we are about to return nothing for a 'blocking' read and we have
  +     * some data in our zlib buffer, flush it out so we can return something.
  +     */
  +    if (block == APR_BLOCK_READ &&
  +        APR_BRIGADE_EMPTY(ctx->proc_bb) &&
  +        ctx->stream.avail_out < c->bufferSize) {
  +        apr_bucket *tmp_heap;
  +        apr_size_t len;
  +        ctx->stream.next_out = ctx->buffer;
  +        len = c->bufferSize - ctx->stream.avail_out;
  +
  +        ctx->crc = crc32(ctx->crc, (const Bytef *)ctx->buffer, len);
  +        tmp_heap = apr_bucket_heap_create((char *)ctx->buffer, len,
  +                                          NULL, f->c->bucket_alloc);
  +        APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, tmp_heap);
  +        ctx->stream.avail_out = c->bufferSize;
       }
   
       if (!APR_BRIGADE_EMPTY(ctx->proc_bb)) {
  
  
  

Mime
View raw message