From: Paul J. Reder Date: Thu, 18 Dec 2008 17:14:53 +0000 (+0000) Subject: Commit promoted backport of PR46401 X-Git-Tag: 2.2.12~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36601869bd07630f9f7e03e08859b1899003510d;p=thirdparty%2Fapache%2Fhttpd.git Commit promoted backport of PR46401 *) mod_cache: Correctly save Content-Encoding of cachable entity. PR 46401 [Dan Poirier ] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@727767 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d5b2c27fe19..d656b581882 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.12 + *) mod_cache: Correctly save Content-Encoding of cachable entity. PR 46401 + [Dan Poirier ] + *) Output -M and -S dumps (modules and vhosts) to stdout instead of stderr. PR 42571 and PR 44266 (dup). [Dan Poirier ] diff --git a/STATUS b/STATUS index de91f3fe6a2..c22597128d9 100644 --- a/STATUS +++ b/STATUS @@ -86,14 +86,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_cache: Correctly save Content-Encoding of cachable entity. PR 46401 - [Dan Poirier ] - Trunk version of patch (committed by rpluem): - http://svn.apache.org/viewvc?view=rev&revision=726796 - Backport version of patch: - http://people.apache.org/~rederpj/backport_PR46401_cache_Content-Encoding.diff - +1: rederpj, rpluem, covener - * mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init when result is NULL. This could happen if LDAP initialization failed. PR 45994. [Dan Poirier ] diff --git a/modules/cache/mod_disk_cache.c b/modules/cache/mod_disk_cache.c index 4148b373ca2..fd7cc6c893b 100644 --- a/modules/cache/mod_disk_cache.c +++ b/modules/cache/mod_disk_cache.c @@ -916,6 +916,12 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info ap_make_content_type(r, r->content_type)); } + if (!apr_table_get(headers_out, "Content-Encoding") + && r->content_encoding) { + apr_table_setn(headers_out, "Content-Encoding", + r->content_encoding); + } + headers_out = apr_table_overlay(r->pool, headers_out, r->err_headers_out); rv = store_table(dobj->hfd, headers_out); diff --git a/modules/cache/mod_mem_cache.c b/modules/cache/mod_mem_cache.c index 65f35327b79..b1f76e799ae 100644 --- a/modules/cache/mod_mem_cache.c +++ b/modules/cache/mod_mem_cache.c @@ -614,6 +614,12 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info ap_make_content_type(r, r->content_type)); } + if (!apr_table_get(headers_out, "Content-Encoding") + && r->content_encoding) { + apr_table_setn(headers_out, "Content-Encoding", + r->content_encoding); + } + headers_out = apr_table_overlay(r->pool, headers_out, r->err_headers_out); mobj->header_out = deep_table_copy(mobj->pool, headers_out);