httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r629615 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_charset_lite.html.en docs/manual/mod/mod_charset_lite.xml modules/filters/mod_charset_lite.c
Date Wed, 20 Feb 2008 21:17:28 GMT
Author: covener
Date: Wed Feb 20 13:17:17 2008
New Revision: 629615

URL: http://svn.apache.org/viewvc?rev=629615&view=rev
Log:
  *) mod_charset_lite: Add ForceAllMimeTypes sub-option to
     CharsetOptions, allowing the administrator to skip the
     mimetype checking that precedes translation.
     PR 44458 [Eric Covener]


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.html.en
    httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.xml
    httpd/httpd/trunk/modules/filters/mod_charset_lite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=629615&r1=629614&r2=629615&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Feb 20 13:17:17 2008
@@ -2,6 +2,11 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_charset_lite: Add ForceAllMimeTypes sub-option to  
+     CharsetOptions, allowing the administrator to skip the
+     mimetype checking that precedes translation.
+     PR 44458 [Eric Covener]
+
   *) mod_include: Correctly handle SSI directives split over multiple filter
      passes.  PR 44447 [Harald Niesche <harald brokenerror.de>]
 

Modified: httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.html.en?rev=629615&r1=629614&r2=629615&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.html.en Wed Feb 20 13:17:17 2008
@@ -166,6 +166,14 @@
       explicitly configured using the <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
directive, <code>NoImplicitAdd</code>
       should be specified so that <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>
       doesn't add its filter.</dd>
+
+      <dt><code>ForceAllMimeTypes | NoForceAllMimeTypes</code></dt>
+      <dd>Normally, <code class="module"><a href="../mod/mod_charset_lite.html">mod_charset_lite</a></code>
will only perform
+      translation on a small subset of possible mimetypes.  When the
+      <code>ForceAllMimeTypes</code> keyord is specified for a given
+      configuration section, translation is performed without regard for
+      mimetype.</dd>
+
     </dl>
 
 </div>

Modified: httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.xml?rev=629615&r1=629614&r2=629615&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_charset_lite.xml Wed Feb 20 13:17:17 2008
@@ -193,6 +193,14 @@
       >AddOutputFilter</directive> directive, <code>NoImplicitAdd</code>
       should be specified so that <module>mod_charset_lite</module>
       doesn't add its filter.</dd>
+
+      <dt><code>ForceAllMimeTypes | NoForceAllMimeTypes</code></dt>
+      <dd>Normally, <module>mod_charset_lite</module> will only perform
+      translation on a small subset of possible mimetypes.  When the
+      <code>ForceAllMimeTypes</code> keyord is specified for a given
+      configuration section, translation is performed without regard for
+      mimetype.</dd>
+
     </dl>
 </usage>
 </directivesynopsis>

Modified: httpd/httpd/trunk/modules/filters/mod_charset_lite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_charset_lite.c?rev=629615&r1=629614&r2=629615&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_charset_lite.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_charset_lite.c Wed Feb 20 13:17:17 2008
@@ -76,6 +76,8 @@
     const char *charset_default; /* how to ship on wire */
     /** module does ap_add_*_filter()? */
     enum {IA_INIT, IA_IMPADD, IA_NOIMPADD} implicit_add;
+    /** treat all mimetypes as text? */
+    enum {FX_INIT, FX_FORCE, FX_NOFORCE} force_xlate;
 } charset_dir_t;
 
 /* charset_filter_ctx_t is created for each filter instance; because the same
@@ -138,6 +140,8 @@
         over->charset_source ? over->charset_source : base->charset_source;
     a->implicit_add =
         over->implicit_add != IA_INIT ? over->implicit_add : base->implicit_add;
+    a->force_xlate=
+        over->force_xlate != FX_INIT ? over->force_xlate : base->force_xlate;
     return a;
 }
 
@@ -176,6 +180,12 @@
     else if (!strcasecmp(flag, "NoImplicitAdd")) {
         dc->implicit_add = IA_NOIMPADD;
     }
+    if (!strcasecmp(flag, "ForceAllMimeTypes")) {
+        dc->force_xlate = FX_FORCE;
+    }
+    else if (!strcasecmp(flag, "NoForceAllMimeTypes")) {
+        dc->force_xlate = FX_NOFORCE;
+    }
     else if (!strncasecmp(flag, "DebugLevel=", 11)) {
         dc->debug = atoi(flag + 11);
     }
@@ -803,7 +813,8 @@
          */
             strcmp(mime_type, DIR_MAGIC_TYPE) == 0 ||
 #endif
-            strncasecmp(mime_type, "message/", 8) == 0) {
+            strncasecmp(mime_type, "message/", 8) == 0 || 
+            dc->force_xlate == FX_FORCE) {
 
             rv = apr_xlate_open(&ctx->xlate,
                                 dc->charset_default, dc->charset_source, f->r->pool);



Mime
View raw message