From 43ea02535f51c9d34fa9c7885822866d02c04481 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Thu, 30 May 2002 22:06:01 +0000 Subject: [PATCH] Why the stack buffer and the copy? This seems much more straightforward. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95413 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_deflate.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 2e6f4b670c..34f430ee0d 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -379,8 +379,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, int done = 0; if (APR_BUCKET_IS_EOS(e)) { - char *buf, *p; - unsigned char crc_array[4], len_array[4]; + char *buf; unsigned int deflate_len; ctx->stream.avail_in = 0; /* should be zero already anyway */ @@ -413,18 +412,9 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, } } - putLong(crc_array, ctx->crc); - putLong(len_array, ctx->stream.total_in); - - p = buf = apr_palloc(r->pool, 8); - *p++ = crc_array[0]; - *p++ = crc_array[1]; - *p++ = crc_array[2]; - *p++ = crc_array[3]; - *p++ = len_array[0]; - *p++ = len_array[1]; - *p++ = len_array[2]; - *p++ = len_array[3]; + buf = apr_palloc(r->pool, 8); + 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); APR_BRIGADE_INSERT_TAIL(ctx->bb, b); -- 2.40.0