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));
  
  
  

Reply via email to