martin      99/12/01 12:45:47

  Modified:    src      CHANGES
               src/main http_protocol.c
  Log:
  EBCDIC: Fix Byte Ranges for EBCDIC platforms. The necessary switch
  between implied conversion for protocol parts and configured
  conversion for document data was missing. The effect of this was that
  PDF files could not be read by Acrobat Reader (which sends long
  lists of byte ranges in each request) when the server was apache
  on ebcdic machines.
  
  Submitted by: Oliver Reh <[EMAIL PROTECTED]>
  Reviewed by:  Martin Kraemer
  
  Revision  Changes    Path
  1.1466    +9 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1465
  retrieving revision 1.1466
  diff -u -r1.1465 -r1.1466
  --- CHANGES   1999/12/01 20:33:58     1.1465
  +++ CHANGES   1999/12/01 20:45:29     1.1466
  @@ -1,5 +1,14 @@
   Changes with Apache 1.3.10
   
  +  *) EBCDIC: Fix Byte Ranges for EBCDIC platforms. The necessary switch
  +     between implied conversion for protocol parts and configured
  +     conversion for document data was missing. The effect of this was that
  +     PDF files could not be read by Acrobat Reader (which sends long
  +     lists of byte ranges in each request) when the server was apache
  +     on ebcdic machines.
  +     [Noted by Oliver Reh <[EMAIL PROTECTED]>, solved by
  +     Martin Kraemer]
  +
     *) Add IndexOptions FoldersFirst to allow fancy-indexed directory
        listings to have the subdirectories always listed at the top.
        [Ken Coar]
  
  
  
  1.281     +22 -1     apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.280
  retrieving revision 1.281
  diff -u -r1.280 -r1.281
  --- http_protocol.c   1999/11/05 15:41:03     1.280
  +++ http_protocol.c   1999/12/01 20:45:41     1.281
  @@ -212,6 +212,14 @@
   {
       long range_start, range_end;
       char *range;
  +#ifdef CHARSET_EBCDIC
  +    /* determine current setting of conversion flag,
  +     * set to ON (protocol strings MUST be converted)
  +     * and reset to original setting before returning
  +     */
  +    int convert = ap_bgetflag(r->connection->client, B_EBCDIC2ASCII);
  +    ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, 1);
  +#endif /*CHARSET_EBCDIC*/
   
       if (!**r_range) {
           if (r->byterange > 1) {
  @@ -220,14 +228,23 @@
               else
                   *tlength += 4 + strlen(r->boundary) + 4;
           }
  +#ifdef CHARSET_EBCDIC
  +     if (!convert)
  +         ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert);
  +#endif /*CHARSET_EBCDIC*/
           return 0;
       }
   
       range = ap_getword(r->pool, r_range, ',');
  -    if (!parse_byterange(range, r->clength, &range_start, &range_end))
  +    if (!parse_byterange(range, r->clength, &range_start, &range_end)) {
  +#ifdef CHARSET_EBCDIC
  +     if (!convert)
  +         ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert);
  +#endif /*CHARSET_EBCDIC*/
           /* Skip this one */
           return internal_byterange(realreq, tlength, r, r_range, offset,
                                     length);
  +    }
   
       if (r->byterange > 1) {
           const char *ct = r->content_type ? r->content_type : 
ap_default_type(r);
  @@ -251,6 +268,10 @@
       else {
           *tlength += range_end - range_start + 1;
       }
  +#ifdef CHARSET_EBCDIC
  +    if (!convert)
  +     ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert);
  +#endif /*CHARSET_EBCDIC*/
       return 1;
   }
   
  
  
  

Reply via email to