You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2006/05/04 13:26:57 UTC

svn commit: r399668 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_charset_lite.c

Author: trawick
Date: Thu May  4 04:26:12 2006
New Revision: 399668

URL: http://svn.apache.org/viewcvs?rev=399668&view=rev
Log:
mod_charset_lite: Bypass translation when the source and dest charsets
are the same.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/filters/mod_charset_lite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?rev=399668&r1=399667&r2=399668&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu May  4 04:26:12 2006
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_charset_lite: Bypass translation when the source and dest charsets
+     are the same.  [Jeff Trawick]
+
   *) mod_mem_cache: Set content type correctly when delivering data from
      cache. PR 39266. [Ruediger Pluem]
 

Modified: httpd/httpd/trunk/modules/filters/mod_charset_lite.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/filters/mod_charset_lite.c?rev=399668&r1=399667&r2=399668&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_charset_lite.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_charset_lite.c Thu May  4 04:26:12 2006
@@ -233,6 +233,8 @@
     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);
 



Re: svn commit: r399668 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_charset_lite.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 05/04/2006 10:51 PM, Jeff Trawick wrote:

> 
> Here is the expected way to encounter that:
> 
> <Location />
> CharsetSourceEnc IBM-1047
> CharsetDefault ISO-8859-1
> </Location>
> 
> <Location /somedir/>
> # already in the right charset
> CharsetSourceEnc ISO-8859-1
> </Location>
> 
> So we shouldn't go through the motions when processing /somedir/

Understood. Thanks for explanation. So I am +1 on this for backport.

Regards

RĂ¼diger



Re: svn commit: r399668 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_charset_lite.c

Posted by Jeff Trawick <tr...@gmail.com>.
On 5/4/06, Ruediger Pluem <rp...@apache.org> wrote:
>
>
> On 05/04/2006 01:26 PM, wrote:
> > Author: trawick
>
> >
> > +  *) mod_charset_lite: Bypass translation when the source and dest charsets
> > +     are the same.  [Jeff Trawick]
>
> As I am not an expert on mod_charset_lite a short question:
> Can this ever happen apart from a situation where the server is misconfigured
> by setting CharsetDefault and CharsetSourceEnc to the same value in the configuration?

Here is the expected way to encounter that:

<Location />
CharsetSourceEnc IBM-1047
CharsetDefault ISO-8859-1
</Location>

<Location /somedir/>
# already in the right charset
CharsetSourceEnc ISO-8859-1
</Location>

So we shouldn't go through the motions when processing /somedir/

Re: svn commit: r399668 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_charset_lite.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 05/04/2006 01:26 PM, wrote:
> Author: trawick

>  
> +  *) mod_charset_lite: Bypass translation when the source and dest charsets
> +     are the same.  [Jeff Trawick]

As I am not an expert on mod_charset_lite a short question:
Can this ever happen apart from a situation where the server is misconfigured
by setting CharsetDefault and CharsetSourceEnc to the same value in the configuration?

Regards

RĂ¼diger