From d84f534b376a1df5aef16caa29a73937389042e0 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Wed, 29 May 2002 07:23:10 +0000 Subject: [PATCH] Add a note indicating what it would take to get MTIME field populated. (I did this locally, but didn't figure it was worth committing, but it's still worth noting.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95343 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_deflate.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 001af661fa..90b4e1569e 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -329,9 +329,21 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, return ap_pass_brigade(f->next, bb); } + /* RFC 1952 Section 2.3 dictates the gzip header: + * + * +---+---+---+---+---+---+---+---+---+---+ + * |ID1|ID2|CM |FLG| MTIME |XFL|OS | + * +---+---+---+---+---+---+---+---+---+---+ + * + * If we wish to populate in MTIME (as hinted in RFC 1952), do: + * putLong(date_array, apr_time_now() / APR_USEC_PER_SEC); + * where date_array is a char[4] and then print date_array in the + * MTIME position. + */ buf = apr_psprintf(r->pool, "%c%c%c%c%c%c%c%c%c%c", deflate_magic[0], - deflate_magic[1], Z_DEFLATED, 0 /* flags */ , 0, 0, - 0, 0 /* time */ , 0 /* xflags */ , OS_CODE); + deflate_magic[1], Z_DEFLATED, 0 /* flags */, + 0, 0, 0, 0 /* 4 chars for mtime */, + 0 /* xflags */, OS_CODE); e = apr_bucket_pool_create(buf, 10, r->pool, f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->bb, e); -- 2.40.0