Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 70491 invoked by uid 500); 14 Jun 2002 07:58:36 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 70480 invoked by uid 500); 14 Jun 2002 07:58:36 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 14 Jun 2002 07:58:34 -0000 Message-ID: <20020614075834.36216.qmail@icarus.apache.org> From: jerenkrantz@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/filters mod_deflate.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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)) {