From: Ruediger Pluem Date: Sat, 29 Jul 2006 12:55:26 +0000 (+0000) Subject: * Use a define for the number of validation bytes (CRC and length) after the X-Git-Tag: 2.3.0~2196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0649a455ad2a2b76a7ceea0d68bebef64a0e016b;p=thirdparty%2Fapache%2Fhttpd.git * Use a define for the number of validation bytes (CRC and length) after the compressed data git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@426791 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 2cecccff850..5dab2b47da9 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -215,6 +215,8 @@ typedef struct deflate_ctx_t int (*libz_end_func)(z_streamp); } deflate_ctx; +/* Number of validation bytes (CRC and length) after the compressed data */ +#define VALIDATION_SIZE 8 /* Do not update ctx->crc, see comment in flush_libz_buffer */ #define NO_UPDATE_CRC 0 /* Do update ctx->crc, see comment in flush_libz_buffer */ @@ -485,11 +487,12 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, flush_libz_buffer(ctx, c, f->c->bucket_alloc, deflate, Z_FINISH, NO_UPDATE_CRC); - buf = apr_palloc(r->pool, 8); + buf = apr_palloc(r->pool, VALIDATION_SIZE); putLong((unsigned char *)&buf[0], ctx->crc); putLong((unsigned char *)&buf[4], ctx->stream.total_in); - b = apr_bucket_pool_create(buf, 8, r->pool, f->c->bucket_alloc); + b = apr_bucket_pool_create(buf, VALIDATION_SIZE, r->pool, + f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->bb, b); ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Zlib: Compressed %ld to %ld : URL %s",