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 2005/08/27 17:02:10 UTC

svn commit: r240425 - in /httpd/httpd/branches/2.0.x: CHANGES STATUS docs/manual/env.xml include/http_core.h modules/http/http_protocol.c server/protocol.c

Author: trawick
Date: Sat Aug 27 08:02:05 2005
New Revision: 240425

URL: http://svn.apache.org/viewcvs?rev=240425&view=rev
Log:
Backport from trunk:

  *) Support the suppress-error-charset setting, as with Apache 1.3.x.
     PR 31274.

Reviewed by: jorton, nd


Modified:
    httpd/httpd/branches/2.0.x/CHANGES
    httpd/httpd/branches/2.0.x/STATUS
    httpd/httpd/branches/2.0.x/docs/manual/env.xml
    httpd/httpd/branches/2.0.x/include/http_core.h
    httpd/httpd/branches/2.0.x/modules/http/http_protocol.c
    httpd/httpd/branches/2.0.x/server/protocol.c

Modified: httpd/httpd/branches/2.0.x/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/CHANGES?rev=240425&r1=240424&r2=240425&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.0.x/CHANGES [utf-8] Sat Aug 27 08:02:05 2005
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.0.55
 
+  *) Support the suppress-error-charset setting, as with Apache 1.3.x.
+     PR 31274.  [Jeff Trawick]
+
   *) EBCDIC: Handle chunked input from client or, with proxy, origin
      server.  [Jeff Trawick]
 

Modified: httpd/httpd/branches/2.0.x/STATUS
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/STATUS?rev=240425&r1=240424&r2=240425&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/STATUS (original)
+++ httpd/httpd/branches/2.0.x/STATUS Sat Aug 27 08:02:05 2005
@@ -276,11 +276,6 @@
         PR: 34452
         +1: jorton
 
-     *) Support the suppress-error-charset setting, as with Apache 1.3.x.
-        PR 31274. (current docs say it works with Apache from 2.0.40 ;) )
-        http://svn.apache.org/viewcvs?rev=170354&view=rev
-        +1: trawick, jorton, nd
-
      *) mod_mime_magic: Handle CRLF-format magic files so that it works with
         the default installation on Windows. 
         http://svn.apache.org/viewcvs?rev=179622&view=rev

Modified: httpd/httpd/branches/2.0.x/docs/manual/env.xml
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/docs/manual/env.xml?rev=240425&r1=240424&r2=240425&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/docs/manual/env.xml (original)
+++ httpd/httpd/branches/2.0.x/docs/manual/env.xml Sat Aug 27 08:02:05 2005
@@ -339,7 +339,7 @@
    <section id="suppress-error-charset">
        <title>suppress-error-charset</title>
 
-    <p><em>Available in versions after 2.0.40</em></p>
+    <p><em>Available in versions after 2.0.54</em></p>
 
     <p>When Apache issues a redirect in response to a client request,
     the response includes some actual text to be displayed in case

Modified: httpd/httpd/branches/2.0.x/include/http_core.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/include/http_core.h?rev=240425&r1=240424&r2=240425&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/include/http_core.h (original)
+++ httpd/httpd/branches/2.0.x/include/http_core.h Sat Aug 27 08:02:05 2005
@@ -332,6 +332,9 @@
     char **response_code_strings; /* from ap_custom_response(), not from
                                    * ErrorDocument
                                    */
+    /* Should addition of charset= be suppressed for this request?
+     */
+    int suppress_charset;
 } core_request_config;
 
 /* Standard entries that are guaranteed to be accessible via

Modified: httpd/httpd/branches/2.0.x/modules/http/http_protocol.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/modules/http/http_protocol.c?rev=240425&r1=240424&r2=240425&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/modules/http/http_protocol.c (original)
+++ httpd/httpd/branches/2.0.x/modules/http/http_protocol.c Sat Aug 27 08:02:05 2005
@@ -2338,7 +2338,19 @@
         r->content_languages = NULL;
         r->content_encoding = NULL;
         r->clength = 0;
-        ap_set_content_type(r, "text/html; charset=iso-8859-1");
+
+        if (apr_table_get(r->subprocess_env,
+                          "suppress-error-charset") != NULL) {
+            core_request_config *request_conf =
+                        ap_get_module_config(r->request_config, &core_module);
+            request_conf->suppress_charset = 1; /* avoid adding default
+                                                 * charset later
+                                                 */
+            ap_set_content_type(r, "text/html");
+        }
+        else {
+            ap_set_content_type(r, "text/html; charset=iso-8859-1");
+        }
 
         if ((status == HTTP_METHOD_NOT_ALLOWED)
             || (status == HTTP_NOT_IMPLEMENTED)) {

Modified: httpd/httpd/branches/2.0.x/server/protocol.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/server/protocol.c?rev=240425&r1=240424&r2=240425&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/server/protocol.c (original)
+++ httpd/httpd/branches/2.0.x/server/protocol.c Sat Aug 27 08:02:05 2005
@@ -106,6 +106,7 @@
     core_dir_config *conf =
         (core_dir_config *)ap_get_module_config(r->per_dir_config,
                                                 &core_module);
+    core_request_config *request_conf;
     apr_size_t type_len;
 
     if (!type) {
@@ -113,6 +114,12 @@
     }
 
     if (conf->add_default_charset != ADD_DEFAULT_CHARSET_ON) {
+        return type;
+    }
+
+    request_conf =
+        ap_get_module_config(r->request_config, &core_module);
+    if (request_conf->suppress_charset) {
         return type;
     }