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 CHANGES
Date Wed, 17 May 2000 03:19:45 GMT
trawick     00/05/16 20:19:43

  Modified:    src/include httpd.h util_ebcdic.h
               src/main http_protocol.c http_request.c
               src      CHANGES
  Log:
  include translation information in the request_rec;
  finish converting ap_bsetflag(B_ASCII2EBCDIC or B_EBCDIC2ASCII) to
  ap_bsetopt(BO_WXLATE or BO_RXLATE)
  
  Revision  Changes    Path
  1.46      +14 -0     apache-2.0/src/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- httpd.h	2000/05/05 23:17:53	1.45
  +++ httpd.h	2000/05/17 03:19:36	1.46
  @@ -584,6 +584,16 @@
   
   #include "util_uri.h"
   
  +#ifdef APACHE_XLATE
  +#include "apr_xlate.h"
  +
  +struct ap_rr_xlate {
  +    /* contents are experimental! expect it to change! */
  +    ap_xlate_t *to_net;
  +    ap_xlate_t *from_net;
  +};
  +#endif /*APACHE_XLATE*/
  +
   struct process_rec {
       ap_pool_t *pool;  /* Global pool. Please try to cleared on _all_ exits */
       ap_pool_t *pconf; /* aka configuration pool, cleared on restarts */
  @@ -741,6 +751,10 @@
    */
       const struct htaccess_result *htaccess;
   
  +#ifdef APACHE_XLATE
  +    struct ap_rr_xlate *rrx;
  +#endif /*APACHE_XLATE*/
  +    
   /* Things placed at the end of the record to avoid breaking binary
    * compatibility.  It would be nice to remember to reorder the entire
    * record to improve 64bit alignment the next time we need to break
  
  
  
  1.4       +1 -3      apache-2.0/src/include/util_ebcdic.h
  
  Index: util_ebcdic.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/util_ebcdic.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- util_ebcdic.h	2000/05/15 17:51:17	1.3
  +++ util_ebcdic.h	2000/05/17 03:19:36	1.4
  @@ -66,9 +66,7 @@
   #endif
   
   #include "apr_xlate.h"
  -
  -extern ap_xlate_t *ap_hdrs_to_ascii, *ap_hdrs_from_ascii;
  -extern ap_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii;
  +#include "util_charset.h"
   
   ap_status_t ap_init_ebcdic(ap_pool_t *);
   
  
  
  
  1.68      +64 -76    apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- http_protocol.c	2000/05/10 19:07:43	1.67
  +++ http_protocol.c	2000/05/17 03:19:38	1.68
  @@ -75,6 +75,7 @@
   #include "http_log.h"           /* For errors detected in basic auth common
                                    * support code... */
   #include "util_date.h"          /* For parseHTTPdate and BAD_DATE */
  +#include "util_charset.h"
   #include "mpm_status.h"
   #include <stdarg.h>
   
  @@ -90,28 +91,6 @@
             ap_bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \
     } while (0)
   
  -#ifdef CHARSET_EBCDIC
  -/* Save & Restore the current conversion settings
  - * "input"  means: ASCII -> EBCDIC (when reading MIME Headers and PUT/POST data)
  - * "output" means: EBCDIC -> ASCII (when sending MIME Headers and Chunks)
  - */
  -
  -#define PUSH_EBCDIC_INPUTCONVERSION_STATE(_buff, _onoff) \
  -        int _convert_in = ap_bgetflag(_buff, B_ASCII2EBCDIC); \
  -        ap_bsetflag(_buff, B_ASCII2EBCDIC, _onoff);
  -
  -#define POP_EBCDIC_INPUTCONVERSION_STATE(_buff) \
  -        ap_bsetflag(_buff, B_ASCII2EBCDIC, _convert_in);
  -
  -#define PUSH_EBCDIC_OUTPUTCONVERSION_STATE(_buff, _onoff) \
  -        int _convert_out = ap_bgetflag(_buff, B_EBCDIC2ASCII); \
  -        ap_bsetflag(_buff, B_EBCDIC2ASCII, _onoff);
  -
  -#define POP_EBCDIC_OUTPUTCONVERSION_STATE(_buff) \
  -        ap_bsetflag(_buff, B_EBCDIC2ASCII, _convert_out);
  -
  -#endif /*CHARSET_EBCDIC*/
  -
   /*
    * Builds the content-type that should be sent to the client from the
    * content-type specified.  The following rules are followed:
  @@ -281,13 +260,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
  -     */
  -    PUSH_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client, 1);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    /* determine current translation handle, set to the one for
  +     * protocol strings, and reset to original setting before
  +     * returning
  +     */
  +    AP_PUSH_OUTPUTCONVERSION_STATE(r->connection->client,
  +                                   ap_hdrs_to_ascii);
  +#endif /*APACHE_XLATE*/
   
       if (!**r_range) {
           if (r->byterange > 1) {
  @@ -296,17 +276,17 @@
               else
                   *tlength += 4 + strlen(r->boundary) + 4;
           }
  -#ifdef CHARSET_EBCDIC
  -        POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +        AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
  +#endif /*APACHE_XLATE*/
           return 0;
       }
   
       range = ap_getword(r->pool, r_range, ',');
       if (!parse_byterange(range, r->clength, &range_start, &range_end))
  -#ifdef CHARSET_EBCDIC
  -        POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +        AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
  +#endif /*APACHE_XLATE*/
           /* Skip this one */
           return internal_byterange(realreq, tlength, r, r_range, offset,
                                     length);
  @@ -333,9 +313,9 @@
       else {
           *tlength += range_end - range_start + 1;
       }
  -#ifdef CHARSET_EBCDIC
  -    POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
  +#endif /*APACHE_XLATE*/
       return 1;
   }
   
  @@ -750,17 +730,17 @@
       char *pos, next;
       int retval;
       int total = 0;
  -#ifdef CHARSET_EBCDIC
  +#ifdef APACHE_XLATE
       /* When getline() is called, the HTTP protocol is in a state
        * where we MUST be reading "plain text" protocol stuff,
        * (Request line, MIME headers, Chunk sizes) regardless of
        * the MIME type and conversion setting of the document itself.
  -     * Save the current setting of the ASCII-EBCDIC conversion flag
  -     * for uploads, then temporarily set it to ON
  +     * Save the current setting of the translation handle for
  +     * uploads, then temporarily set it to the one used for headers
        * (and restore it before returning).
        */
  -    PUSH_EBCDIC_INPUTCONVERSION_STATE(in, 1);
  -#endif /*CHARSET_EBCDIC*/
  +    AP_PUSH_INPUTCONVERSION_STATE(in, ap_hdrs_from_ascii);
  +#endif /*APACHE_XLATE*/
   
       pos = s;
   
  @@ -804,10 +784,10 @@
                     && (next = ap_blookc(in))
                     && ((next == ' ') || (next == '\t')));
   
  -#ifdef CHARSET_EBCDIC
  -    /* restore ASCII->EBCDIC conversion state */
  -    POP_EBCDIC_INPUTCONVERSION_STATE(in);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    /* restore translation handle */
  +    AP_POP_INPUTCONVERSION_STATE(in);
  +#endif /*APACHE_XLATE*/
   
       return total;
   }
  @@ -1049,8 +1029,12 @@
       r->status          = HTTP_REQUEST_TIME_OUT;  /* Until we get a request */
       r->the_request     = NULL;
   
  -#ifdef CHARSET_EBCDIC
  -    ap_bsetflag(r->connection->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1);
  +#ifdef APACHE_XLATE
  +    r->rrx = ap_pcalloc(p, sizeof(struct ap_rr_xlate));
  +    r->rrx->to_net = ap_locale_to_ascii;
  +    r->rrx->from_net = ap_locale_from_ascii;
  +    ap_bsetopt(r->connection->client, BO_WXLATE, &ap_hdrs_to_ascii);
  +    ap_bsetopt(r->connection->client, BO_RXLATE, &ap_hdrs_from_ascii);
   #endif
   
       ap_bsetopt(conn->client, BO_TIMEOUT,
  @@ -1263,7 +1247,7 @@
           return AUTH_REQUIRED;
       }
   
  -    /* CHARSET_EBCDIC Issue's here ?!? Compare with 32/9 instead
  +    /* APACHE_XLATE Issue's here ?!? Compare with 32/9 instead
        * as we are operating on an octed stream ?
        */
       while (*auth_line== ' ' || *auth_line== '\t')
  @@ -1422,9 +1406,10 @@
       else
           protocol = AP_SERVER_PROTOCOL;
   
  -#ifdef CHARSET_EBCDIC
  -    { PUSH_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client, 1);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    { AP_PUSH_OUTPUTCONVERSION_STATE(r->connection->client,
  +                                     ap_hdrs_to_ascii);
  +#endif /*APACHE_XLATE*/
   
       /* Output the HTTP/1.x Status-Line and the Date and Server fields */
   
  @@ -1437,9 +1422,9 @@
   
       ap_table_unset(r->headers_out, "Date");        /* Avoid bogosity */
       ap_table_unset(r->headers_out, "Server");
  -#ifdef CHARSET_EBCDIC
  -    POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client); }
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    AP_POP_OUTPUTCONVERSION_STATE(r->connection->client); }
  +#endif /*APACHE_XLATE*/
   }
   
   /* Navigator versions 2.x, 3.x and 4.0 betas up to and including 4.0b2
  @@ -1673,9 +1658,10 @@
   
       ap_basic_http_header(r);
   
  -#ifdef CHARSET_EBCDIC
  -    { PUSH_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client, 1);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    { AP_PUSH_OUTPUTCONVERSION_STATE(r->connection->client,
  +                                     ap_hdrs_to_ascii);
  +#endif /*APACHE_XLATE*/
   
       ap_set_keepalive(r);
   
  @@ -1727,9 +1713,9 @@
       /* Set buffer flags for the body */
       if (r->chunked)
           ap_bsetflag(r->connection->client, B_CHUNK, 1);
  -#ifdef CHARSET_EBCDIC
  -    POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client); }
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +    AP_POP_OUTPUTCONVERSION_STATE(r->connection->client); }
  +#endif /*APACHE_XLATE*/
   }
   
   /* finalize_request_protocol is called at completion of sending the
  @@ -1740,8 +1726,9 @@
   API_EXPORT(void) ap_finalize_request_protocol(request_rec *r)
   {
       if (r->chunked && !r->connection->aborted) {
  -#ifdef CHARSET_EBCDIC
  -	PUSH_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client, 1);
  +#ifdef APACHE_XLATE
  +	AP_PUSH_OUTPUTCONVERSION_STATE(r->connection->client,
  +                                       ap_hdrs_to_ascii);
   #endif
           /*
            * Turn off chunked encoding --- we can only do this once.
  @@ -1753,9 +1740,9 @@
           /* If we had footer "headers", we'd send them now */
           ap_rputs(CRLF, r);
   
  -#ifdef CHARSET_EBCDIC
  -	POP_EBCDIC_OUTPUTCONVERSION_STATE(r->connection->client);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +	AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
  +#endif /*APACHE_XLATE*/
       }
   }
   
  @@ -1864,9 +1851,9 @@
                             strncasecmp(typep, "multipart/", 10) == 0 ||
                             strcasecmp (typep, "application/x-www-form-urlencoded") == 0
                            );
  -        ap_bsetflag(r->connection->client, B_ASCII2EBCDIC, convert_in);
  +        ap_bsetopt(r->connection->client, BO_RXLATE, ap_locale_from_ascii);
       }
  -#endif
  +#endif /*CHARSET_EBCDIC*/
   
       return OK;
   }
  @@ -2056,19 +2043,20 @@
       r->remaining -= len_read;
   
       if (r->remaining == 0) {    /* End of chunk, get trailing CRLF */
  -#ifdef CHARSET_EBCDIC
  +#ifdef APACHE_XLATE
           /* Chunk end is Protocol stuff! Set conversion = 1 to read CR LF: */
  -        PUSH_EBCDIC_INPUTCONVERSION_STATE(r->connection->client, 1);
  -#endif /*CHARSET_EBCDIC*/
  +        AP_PUSH_INPUTCONVERSION_STATE(r->connection->client,
  +                                      ap_hdrs_from_ascii);
  +#endif /*APACHE_XLATE*/
   
           if ((c = ap_bgetc(r->connection->client)) == CR) {
               c = ap_bgetc(r->connection->client);
           }
   
  -#ifdef CHARSET_EBCDIC
  -        /* restore ASCII->EBCDIC conversion state */
  -        POP_EBCDIC_INPUTCONVERSION_STATE(r->connection->client);
  -#endif /*CHARSET_EBCDIC*/
  +#ifdef APACHE_XLATE
  +        /* restore previous input translation handle */
  +        AP_POP_INPUTCONVERSION_STATE(r->connection->client);
  +#endif /*APACHE_XLATE*/
   
           if (c != LF) {
               r->connection->keepalive = -1;
  
  
  
  1.25      +18 -7     apache-2.0/src/main/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- http_request.c	2000/04/26 07:14:33	1.24
  +++ http_request.c	2000/05/17 03:19:38	1.25
  @@ -75,6 +75,7 @@
   #include "http_protocol.h"
   #include "http_log.h"
   #include "http_main.h"
  +#include "util_charset.h"
   #include "apr_fnmatch.h"
   
   AP_HOOK_STRUCT(
  @@ -949,14 +950,17 @@
   
   API_EXPORT(int) ap_run_sub_req(request_rec *r)
   {
  -#ifndef CHARSET_EBCDIC
  +#ifndef APACHE_XLATE
       int retval = ap_invoke_handler(r);
  -#else /*CHARSET_EBCDIC*/
  -    /* Save the EBCDIC conversion setting of the caller across subrequests */
  -    int convert = ap_bgetflag(r->connection->client, B_EBCDIC2ASCII);
  -    int retval  = ap_invoke_handler(r);
  -    ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert);
  -#endif /*CHARSET_EBCDIC*/
  +#else /*APACHE_XLATE*/
  +    /* Save the output conversion setting of the caller across subrequests */
  +    int retval;
  +    ap_xlate_t *saved_xlate;
  +
  +    ap_bgetopt(r->connection->client, BO_WXLATE, &saved_xlate);
  +    retval  = ap_invoke_handler(r);
  +    ap_bsetopt(r->connection->client, BO_WXLATE, &saved_xlate);
  +#endif /*APACHE_XLATE*/
       ap_finalize_sub_req_protocol(r);
       return retval;
   }
  @@ -1341,6 +1345,13 @@
           ap_die(access_status, new);
           return NULL;
       }
  +
  +#ifdef APACHE_XLATE
  +    new->rrx = ap_pcalloc(new->pool, sizeof(struct ap_rr_xlate));
  +    new->rrx->to_net = ap_locale_to_ascii;
  +    new->rrx->from_net = ap_locale_from_ascii;
  +    /* QUESTION: should we bsetopt(BO_WXLATE) and bsetop(BO_RXLATE)? */
  +#endif /*APACHE_XLATE*/
   
       return new;
   }
  
  
  
  1.113     +2 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- CHANGES	2000/05/16 19:58:35	1.112
  +++ CHANGES	2000/05/17 03:19:40	1.113
  @@ -1,4 +1,6 @@
   Changes with Apache 2.0a4
  +  *) Apache 2.0 builds and runs on OS/390. [Jeff Trawick, Greg Ames]
  +
     *) Change the EBCDIC support in functions for MD5, SHA1, and base 64 to use
        APR to perform translation, instead of accessing the hard-coded tables
        in 1.3's ebcdic.c. [Jeff Trawick]
  
  
  

Mime
View raw message