httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_core.c
Date Tue, 25 Apr 2000 23:19:16 GMT
trawick     00/04/25 16:19:16

  Modified:    src/main http_core.c
  Log:
  Port a 1.3 EBCDIC fix to 2.0:
  
  This is a port of my 1.3 patch which allows error response strings to be
  translated from ebcdic to ascii.  This bug is triggered by trying to
  access a non-existant .gif for example.  The content type starts out
  being image/gif but is switched by error processing to text/html.
  Without this patch, ap_checkconv() is called too early (before the error
  processing), so the ebcdic conversion flag gets turned off and the
  eventual "404 Not Found" error response is sent to the browser still in
  ebcdic.  Not very pretty.
  
  Submitted by:	Greg Ames
  Reviewed by:	Jeff Trawick
  
  Revision  Changes    Path
  1.54      +13 -8     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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- http_core.c	2000/04/24 12:27:02	1.53
  +++ http_core.c	2000/04/25 23:19:15	1.54
  @@ -2346,14 +2346,7 @@
       ap_mmap_t *mm = NULL;
   #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.
  -     */
  -    int convert_flag = ap_checkconv(r);
  +    int convert_flag;
   #endif
   
       /* This handler has no use for a request body (yet), but we still
  @@ -2402,6 +2395,18 @@
           return errstatus;
       }
   
  +#ifdef CHARSET_EBCDIC
  +    /* ap_checkconv() sets a flag in the buff based on content type  
  +     * to indicate whether text charset conversion should be done
  +     * later.  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.
  +     *
  +     * Note: convert_flag is not used in the MMAP path;
  +     */
  +    convert_flag = ap_checkconv(r);
  +#endif  
   #ifdef USE_MMAP_FILES
       if ((r->finfo.size >= MMAP_THRESHOLD)
   	&& (r->finfo.size < MMAP_LIMIT)
  
  
  

Mime
View raw message