From: Bill Stoddard Date: Thu, 21 Oct 1999 18:28:14 +0000 (+0000) Subject: This patch fixes EBCDIC conversion for Apache 1.3.9 on platforms that X-Git-Tag: 1.3.10~237 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=856a8fef2074a36b2023167a6fed42ea735fc91a;p=apache This patch fixes EBCDIC conversion for Apache 1.3.9 on platforms that 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 --- diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 0f68dfa686..2192ed16dc 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -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));