Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 27147 invoked by uid 6000); 21 Oct 1999 18:28:20 -0000 Received: (qmail 26992 invoked by uid 2016); 21 Oct 1999 18:28:17 -0000 Delivered-To: apcore-apache-2.0-cvs@apache.org Received: (qmail 26934 invoked by uid 215); 21 Oct 1999 18:28:16 -0000 Date: 21 Oct 1999 18:28:16 -0000 Message-ID: <19991021182816.26933.qmail@hyperreal.org> From: stoddard@hyperreal.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/main http_core.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org stoddard 99/10/21 11:28:15 Modified: src/main http_core.c Log: 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 Revision Changes Path 1.21 +8 -9 apache-2.0/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- http_core.c 1999/10/20 21:00:00 1.20 +++ http_core.c 1999/10/21 18:28:14 1.21 @@ -2481,7 +2481,14 @@ 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 @@ #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));