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 Wed, 29 May 2002 06:40:23 GMT
jerenkrantz    02/05/28 23:40:23

  Modified:    modules/filters mod_deflate.c
  Log:
  Implement flushing support for mod_deflate.
  (Review of RFC 1952 indicates that this is indeed easily allowable.)
  
  Revision  Changes    Path
  1.8       +16 -6     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_deflate.c	29 May 2002 05:48:57 -0000	1.7
  +++ mod_deflate.c	29 May 2002 06:40:23 -0000	1.8
  @@ -438,13 +438,23 @@
           }
   
           if (APR_BUCKET_IS_FLUSH(e)) {
  -            /* XXX FIX: do we need the Content-Size set, or can we stream?
  -             * we should be able to stream
  -             */
  +            apr_bucket *bkt;
  +            zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
  +            if (zRC != Z_OK) {
  +                return APR_EGENERAL;
  +            }
   
  -            /* Ignore flush buckets for the moment.. we can't stream as we
  -             * need the size ;(
  -             */
  +            ctx->stream.next_out = ctx->buffer;
  +            len = c->bufferSize - ctx->stream.avail_out;
  +
  +            b = apr_bucket_heap_create((char *)ctx->buffer, len,
  +                                       NULL, f->c->bucket_alloc);
  +            APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
  +            ctx->stream.avail_out = c->bufferSize;
  +
  +            bkt = apr_bucket_flush_create(f->c->bucket_alloc);
  +            APR_BRIGADE_INSERT_TAIL(ctx->bb, bkt);
  +            ap_pass_brigade(f->next, ctx->bb);
               continue;
           }
   
  
  
  

Mime
View raw message