From c06c057a8de442f3a4ce8de6261e4acd0b6d82b1 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 16 Oct 2000 18:00:49 +0000 Subject: [PATCH] Get rid of some old code related to the way that character set translation 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 | 6 --- include/util_charset.h | 10 ----- modules/experimental/mod_charset_lite.c | 9 ---- modules/http/http_protocol.c | 60 ------------------------- modules/http/http_request.c | 5 --- server/util_charset.c | 18 -------- 6 files changed, 108 deletions(-) diff --git a/include/httpd.h b/include/httpd.h index 9a7e6fdf8a..945812f27a 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -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; diff --git a/include/util_charset.h b/include/util_charset.h index 7a24d2b8af..a604de035b 100644 --- a/include/util_charset.h +++ b/include/util_charset.h @@ -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 diff --git a/modules/experimental/mod_charset_lite.c b/modules/experimental/mod_charset_lite.c index 978ffd8f2d..c093e8157d 100644 --- a/modules/experimental/mod_charset_lite.c +++ b/modules/experimental/mod_charset_lite.c @@ -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; diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 63985cbc99..6512a24b33 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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; } diff --git a/modules/http/http_request.c b/modules/http/http_request.c index faf7afc9b1..9b24bd7e84 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -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; } diff --git a/server/util_charset.c b/server/util_charset.c index c8d77ca8cf..99b5e24cea 100644 --- a/server/util_charset.c +++ b/server/util_charset.c @@ -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*/ -- 2.50.1