From: Nick Kew Date: Sun, 7 May 2006 20:57:32 +0000 (+0000) Subject: Backport trawick's mod_charset_lite patch X-Git-Tag: 2.2.3~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0271576703e85c6bff59ff990722321cb71c98c7;p=thirdparty%2Fapache%2Fhttpd.git Backport trawick's mod_charset_lite patch git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@404847 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 2de4c151fd5..e91fea3f454 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.3 + *) mod_charset_lite: Bypass translation when the source and dest charsets + are the same. [Jeff Trawick] + Changes with Apache 2.2.2 *) mod_deflate: work correctly in an internal redirect diff --git a/STATUS b/STATUS index 0d77bac2314..90e3463e944 100644 --- a/STATUS +++ b/STATUS @@ -76,17 +76,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * Remove odd DECLINED code from mod_charset_lite filter. - http://svn.apache.org/viewcvs?rev=399665&view=rev - +1 trawick, rpluem, niq - niq: This is right, but the underlying behaviour (refuse to - work in a proxy) is bad. There's a TODO. - - * mod_charset_lite: Don't go through the motions of translating if - the source and dest charsets are the same. - http://svn.apache.org/viewcvs?rev=399668&view=rev - +1 trawick, rpluem, niq - PATCHES PROPOSED TO BACKPORT FROM TRUNK: * Backport mod_authz_dbd (it's had some testing now) diff --git a/modules/filters/mod_charset_lite.c b/modules/filters/mod_charset_lite.c index 61a27ed67f3..244db60b5e0 100644 --- a/modules/filters/mod_charset_lite.c +++ b/modules/filters/mod_charset_lite.c @@ -232,6 +232,8 @@ static int find_code_page(request_rec *r) if (!strncmp(r->filename, "gone:", 5)) return DECLINED; if (!strncmp(r->filename, "passthrough:", 12)) return DECLINED; if (!strncmp(r->filename, "forbidden:", 10)) return DECLINED; + /* no translation when server and network charsets are set to the same value */ + if (!strcasecmp(dc->charset_source, dc->charset_default)) return DECLINED; mime_type = r->content_type ? r->content_type : ap_default_type(r); @@ -821,9 +823,6 @@ static apr_status_t xlate_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) } } - /* catch proxy requests */ - if (f->r->proxyreq) return DECLINED; - /* Opening the output translation (this used to be done in the fixup hook, * but that was too early: a subsequent type modification, e.g., by a * CGI script, would go unnoticed. Now we do it in the filter itself.)