]> granicus.if.org Git - apache/commitdiff
This patch fixes EBCDIC conversion for Apache 1.3.9 on platforms that
authorBill Stoddard <stoddard@apache.org>
Thu, 21 Oct 1999 18:28:14 +0000 (18:28 +0000)
committerBill Stoddard <stoddard@apache.org>
Thu, 21 Oct 1999 18:28:14 +0000 (18:28 +0000)
support mmap.  Currently, ap_checkconv() is called only if mmap is not
supported, or if mmap fails.  This results in mangled .gif's and .jpg's
etc. because EBCDIC-ASCII conversion is done by default when
CHARSET_EBCDIC is defined.

Note: I suspect all this will radically change when EBCDIC support is
done in an IOL. However, I think it is valuable to put this patch into
Apache 2.0 as a reminder since it is just a code move rather than new code.

Submitted by: Greg Ames
Reviewed by: Bill Stoddard

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

modules/http/http_core.c

index 0f68dfa686931c38a7f30439a5797ca936744b4d..2192ed16dc0f35ed9c4dfda341d1d91349ef0f4c 100644 (file)
@@ -2481,7 +2481,14 @@ static int default_handler(request_rec *r)
     caddr_t mm;
 #endif
 #ifdef CHARSET_EBCDIC
-    int convert_flag;
+    /* To make serving of "raw ASCII text" files easy (they serve faster
+     * since they don't have to be converted from EBCDIC), a new
+     * "magic" type prefix was invented: text/x-ascii-{plain,html,...}
+     * If we detect one of these content types here, we simply correct
+     * the type to the real text/{plain,html,...} type. Otherwise, we
+     * set a flag that translation is required later on.
+     */
+    int convert_flag = ap_checkconv(r);
 #endif
 
     /* This handler has no use for a request body (yet), but we still
@@ -2555,14 +2562,6 @@ static int default_handler(request_rec *r)
 #endif
 
 #ifdef CHARSET_EBCDIC
-       /* To make serving of "raw ASCII text" files easy (they serve faster
-        * since they don't have to be converted from EBCDIC), a new
-        * "magic" type prefix was invented: text/x-ascii-{plain,html,...}
-        * If we detect one of these content types here, we simply correct
-        * the type to the real text/{plain,html,...} type. Otherwise, we
-        * set a flag that translation is required later on.
-        */
-       convert_flag = ap_checkconv(r);
        if (d->content_md5 & 1) {
            ap_table_setn(r->headers_out, "Content-MD5",
                          ap_md5digest(r->pool, fd_os, convert_flag));