]> granicus.if.org Git - apache/commitdiff
Get rid of some old code related to the way that character set translation
authorJeff Trawick <trawick@apache.org>
Mon, 16 Oct 2000 18:00:49 +0000 (18:00 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 16 Oct 2000 18:00:49 +0000 (18:00 +0000)
of protocol data and bodies was performed in the past.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86612 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h
include/util_charset.h
modules/experimental/mod_charset_lite.c
modules/http/http_protocol.c
modules/http/http_request.c
server/util_charset.c

index 9a7e6fdf8aabc46aace4205a2d49d9426d99f06b..945812f27af1a05be2806282c5ee03452add1a1a 100644 (file)
@@ -821,12 +821,6 @@ struct request_rec {
  */
     const struct htaccess_result *htaccess;
 
-#ifdef APACHE_XLATE
-    /** The translation headers for dealing with this request 
-     *  @defvar ap_rr_xlate *rrx */
-    struct ap_rr_xlate *rrx;
-#endif /*APACHE_XLATE*/
-
     /** A list of output filters to be used for this request 
      *  @defvar ap_filter_t *output_filters */
     struct ap_filter_t *output_filters;
index 7a24d2b8af18dad5e280e81d579680ce8ff15ec5..a604de035bbde1fc9e3f2635d99f14dedabe5592 100644 (file)
@@ -117,16 +117,6 @@ extern apr_xlate_t *ap_locale_from_ascii;
 #define AP_POP_OUTPUTCONVERSION_STATE(_buff) \
         ap_bsetopt(_buff, BO_WXLATE, &saved_output_xlate)
 
-/**
- * set up character set translation (a.k.a. recoding) for content.
- * @param r The current request
- * @param output Is this content outgoing or incoming
- * @param The translation handle to use for the actual work
- * @deffunc apr_status_t ap_set_content_xlate(request_rec *r, int output, apr_xlate_t *xlate)
- */
-AP_DECLARE(apr_status_t) ap_set_content_xlate(request_rec *r, int output,
-                                             apr_xlate_t *xlate);
-
 #ifdef __cplusplus
 }
 #endif
index 978ffd8f2d5cdc5376cb1fa75d38cfcd8d33be96..c093e8157dd902eafba25fc19465493d6c0bcfec 100644 (file)
@@ -328,15 +328,6 @@ static int find_code_page(request_rec *r)
                           dc->charset_default, dc->charset_source);
             return HTTP_INTERNAL_SERVER_ERROR;
         }
-
-/* Can't delete this yet :( #ifdef OLD */
-        rv = ap_set_content_xlate(r, 0, input_ctx->xlate);
-        if (rv != APR_SUCCESS) {
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
-                          "can't set content input translation");
-            return HTTP_INTERNAL_SERVER_ERROR;
-        }
-/* #endif */
     }
 
     return DECLINED;
index 63985cbc999cb3b5f5b89aca8e4a7702cfdf00af..6512a24b331654f03d14f5ede43752b1860ddc71 100644 (file)
@@ -346,14 +346,6 @@ static int internal_byterange(int realreq, long *tlength, request_rec *r,
 {
     long range_start, range_end;
     char *range;
-#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) {
@@ -370,17 +362,11 @@ static int internal_byterange(int realreq, long *tlength, request_rec *r,
                 *tlength += 4 + strlen(r->boundary) + 4;
             }
         }
-#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 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);
@@ -408,9 +394,6 @@ static int internal_byterange(int realreq, long *tlength, request_rec *r,
     else {
         *tlength += range_end - range_start + 1;
     }
-#ifdef APACHE_XLATE
-    AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
-#endif /*APACHE_XLATE*/
     return 1;
 }
 
@@ -1306,11 +1289,6 @@ request_rec *ap_read_request(conn_rec *conn)
     r->output_filters  = conn->output_filters;
     r->input_filters   = conn->input_filters;
 
-#ifdef APACHE_XLATE
-    r->rrx = apr_pcalloc(p, sizeof(struct ap_rr_xlate));
-    ap_set_content_xlate(r, 0, ap_locale_from_ascii);
-#endif /*APACHE_XLATE*/
-
     ap_bsetopt(conn->client, BO_TIMEOUT,
                conn->keptalive
                ? &r->server->keep_alive_timeout
@@ -1704,11 +1682,6 @@ AP_DECLARE(void) ap_basic_http_header(request_rec *r)
         protocol = AP_SERVER_PROTOCOL;
     }
 
-#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 */
 
     (void) checked_bputstrs(r, protocol, " ", r->status_line, CRLF, NULL);
@@ -1720,9 +1693,6 @@ AP_DECLARE(void) ap_basic_http_header(request_rec *r)
 
     apr_table_unset(r->headers_out, "Date");        /* Avoid bogosity */
     apr_table_unset(r->headers_out, "Server");
-#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
@@ -2145,11 +2115,6 @@ AP_DECLARE(void) ap_send_http_header(request_rec *r)
 
     ap_basic_http_header(r);
 
-#ifdef APACHE_XLATE
-    { AP_PUSH_OUTPUTCONVERSION_STATE(r->connection->client,
-                                     ap_hdrs_to_ascii);
-#endif /*APACHE_XLATE*/
-
     ap_set_keepalive(r);
 
     if (r->chunked) {
@@ -2211,9 +2176,6 @@ AP_DECLARE(void) ap_send_http_header(request_rec *r)
     if (r->chunked) {
         ap_bsetflag(r->connection->client, B_CHUNK, 1);
     }
-#ifdef APACHE_XLATE
-    AP_POP_OUTPUTCONVERSION_STATE(r->connection->client); }
-#endif /*APACHE_XLATE*/
 }
 
 /* finalize_request_protocol is called at completion of sending the
@@ -2322,28 +2284,6 @@ AP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy)
         return HTTP_REQUEST_ENTITY_TOO_LARGE;
     }
 
-#ifdef CHARSET_EBCDIC
-    {
-        /* @@@ Temporary kludge for guessing the conversion @@@
-         * from looking at the MIME header. 
-         * If no Content-Type header is found, text conversion is assumed.
-         */
-        const char *typep = apr_table_get(r->headers_in, "Content-Type");
-        int convert_in = (typep == NULL ||
-                          strncasecmp(typep, "text/", 5) == 0 ||
-                          strncasecmp(typep, "message/", 8) == 0 ||
-                          strncasecmp(typep, "multipart/", 10) == 0 ||
-                          strcasecmp (typep, "application/x-www-form-urlencoded") == 0
-                         );
-        /* By default, we translate content on input.  Turn off translation
-         * if it isn't text.
-         */
-        if (!convert_in) {
-            ap_set_content_xlate(r, 0, NULL);
-        }
-    }
-#endif /*CHARSET_EBCDIC*/
-
     return OK;
 }
 
index faf7afc9b1d5735f907f5132e4e9dbf152c76947..9b24bd7e84261402fd105c89c4107384430f51bd 100644 (file)
@@ -1451,11 +1451,6 @@ static request_rec *internal_internal_redirect(const char *new_uri,
         return NULL;
     }
 
-#ifdef APACHE_XLATE
-    new->rrx = apr_pcalloc(new->pool, sizeof(struct ap_rr_xlate));
-    ap_set_content_xlate(new, 0, ap_locale_from_ascii);
-#endif /*APACHE_XLATE*/
-
     return new;
 }
 
index c8d77ca8cff23bb24da083723bed7ca679939612..99b5e24cea446c21313f08b1cc6fdc45976e447a 100644 (file)
@@ -96,22 +96,4 @@ apr_xlate_t *ap_hdrs_to_ascii, *ap_hdrs_from_ascii;
 
 apr_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii;
 
-AP_DECLARE(apr_status_t) ap_set_content_xlate(request_rec *r, int output, 
-                                             apr_xlate_t *xlate)
-{
-    apr_status_t rv;
-
-    ap_assert(output == 0);
-
-    r->rrx->from_net = xlate;
-    rv = ap_bsetopt(r->connection->client, BO_RXLATE, &xlate);
-
-    if (rv) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
-                      "BO_RXLATE failed");
-    }
-
-    return rv;
-}
-
 #endif /*APACHE_XLATE*/