]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
EBCDIC: Rearrange calls to ap_checkconv() so that most handlers
authorJeff Trawick <trawick@apache.org>
Sat, 3 Jun 2000 22:41:01 +0000 (22:41 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 3 Jun 2000 22:41:01 +0000 (22:41 +0000)
won't need to call it.
Submitted by: Greg Ames, Jeff Trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85397 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_cgi.c
modules/generators/mod_cgid.c
modules/http/http_core.c
modules/http/http_protocol.c

index c969a40c69b964e5c1c61f70340203ce889c132c..6dd6a52cf9d00d4efc77478b54fbb1edd6117ef6 100644 (file)
@@ -599,11 +599,6 @@ static int cgi_handler(request_rec *r)
            return log_script(r, conf, ret, dbuf, sbuf, script_in, script_err);
        }
 
-#ifdef CHARSET_EBCDIC
-        /* Now check the Content-Type to decide if conversion is needed */
-        ap_checkconv(r);
-#endif /*CHARSET_EBCDIC*/
-
        location = ap_table_get(r->headers_out, "Location");
 
        if (location && location[0] == '/' && r->status == 200) {
index e8f932745be09a43c988a0497963ffbc1af59793..e45c89a5b2d033ecc046a98b2b886177735c985f 100644 (file)
@@ -938,11 +938,6 @@ static int cgid_handler(request_rec *r)
             return log_script(r, conf, ret, dbuf, sbuf, script, NULL); 
         } 
 
-#ifdef CHARSET_EBCDIC 
-        /* Now check the Content-Type to decide if conversion is needed */ 
-        ap_checkconv(r); 
-#endif /*CHARSET_EBCDIC*/ 
-
         location = ap_table_get(r->headers_out, "Location"); 
 
         if (location && location[0] == '/' && r->status == 200) { 
index 6de6ff3c978ac9a001ef3de5b7103c2244196b9c..4a948e296ab051691fe01c73aa1313647ef18193 100644 (file)
@@ -2416,14 +2416,17 @@ static int default_handler(request_rec *r)
     }
 
 #ifdef CHARSET_EBCDIC
-    /* By default, we convert all content.  ap_checkconv() can decide
-     * that conversion shouldn't be performed.  Also, if the content type
-     * contains the "magic" prefix for serving raw ascii
-     * (text/x-ascii-{plain,html,...}), the type is corrected to the real
-     * text/{plain,html,...} type which goes into the headers.
-     */
-    ap_checkconv(r);
-#endif  
+    if (d->content_md5 & 1) {
+        /* The call to ap_checkconv() in ap_send_http_header() is
+         * sufficient for most paths.  Sending the MD5 digest in a
+         * header is special in that any change to translation decided
+         * by ap_checkconv() must be done before building that header,
+         * and thus before calling ap_send_http_header().
+         */
+        ap_checkconv(r);
+    }
+#endif /* CHARSET_EBCDIC */
+      
 #ifdef USE_MMAP_FILES
     if ((r->finfo.size >= MMAP_THRESHOLD)
        && (r->finfo.size < MMAP_LIMIT)
index 14c638d7a1388d8262f4d5b3c248f22649dffc51..4eaa06f6c6b3953ff0c6d9b5442ec8beaa817b81 100644 (file)
@@ -1641,6 +1641,20 @@ API_EXPORT(void) ap_send_http_header(request_rec *r)
         return;
     }
 
+#ifdef CHARSET_EBCDIC
+    /* By default, we convert all content.  ap_checkconv() can decide
+     * that conversion shouldn't be performed.  Also, if the content type
+     * contains the "magic" prefix for serving raw ascii
+     * (text/x-ascii-{plain,html,...}), the type is corrected to the real
+     * text/{plain,html,...} type which goes into the headers.
+     * This may not seem like the best place to put this call, but doing
+     * it here avoids having to call it in every handler (which is
+     * particularly hard to do with handlers in modules which aren't
+     * part of the Apache httpd distribution).
+     */
+    ap_checkconv(r);
+#endif
+      
     /*
      * Now that we are ready to send a response, we need to combine the two
      * header field tables into a single table.  If we don't do this, our