mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
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
This commit is contained in:
@@ -821,12 +821,6 @@ struct request_rec {
|
|||||||
*/
|
*/
|
||||||
const struct htaccess_result *htaccess;
|
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
|
/** A list of output filters to be used for this request
|
||||||
* @defvar ap_filter_t *output_filters */
|
* @defvar ap_filter_t *output_filters */
|
||||||
struct ap_filter_t *output_filters;
|
struct ap_filter_t *output_filters;
|
||||||
|
@@ -117,16 +117,6 @@ extern apr_xlate_t *ap_locale_from_ascii;
|
|||||||
#define AP_POP_OUTPUTCONVERSION_STATE(_buff) \
|
#define AP_POP_OUTPUTCONVERSION_STATE(_buff) \
|
||||||
ap_bsetopt(_buff, BO_WXLATE, &saved_output_xlate)
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -328,15 +328,6 @@ static int find_code_page(request_rec *r)
|
|||||||
dc->charset_default, dc->charset_source);
|
dc->charset_default, dc->charset_source);
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
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;
|
return DECLINED;
|
||||||
|
@@ -346,14 +346,6 @@ static int internal_byterange(int realreq, long *tlength, request_rec *r,
|
|||||||
{
|
{
|
||||||
long range_start, range_end;
|
long range_start, range_end;
|
||||||
char *range;
|
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_range) {
|
||||||
if (r->byterange > 1) {
|
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;
|
*tlength += 4 + strlen(r->boundary) + 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef APACHE_XLATE
|
|
||||||
AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
|
|
||||||
#endif /*APACHE_XLATE*/
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
range = ap_getword(r->pool, r_range, ',');
|
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 APACHE_XLATE
|
|
||||||
AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
|
|
||||||
#endif /*APACHE_XLATE*/
|
|
||||||
/* Skip this one */
|
/* Skip this one */
|
||||||
return internal_byterange(realreq, tlength, r, r_range, offset,
|
return internal_byterange(realreq, tlength, r, r_range, offset,
|
||||||
length);
|
length);
|
||||||
@@ -408,9 +394,6 @@ static int internal_byterange(int realreq, long *tlength, request_rec *r,
|
|||||||
else {
|
else {
|
||||||
*tlength += range_end - range_start + 1;
|
*tlength += range_end - range_start + 1;
|
||||||
}
|
}
|
||||||
#ifdef APACHE_XLATE
|
|
||||||
AP_POP_OUTPUTCONVERSION_STATE(r->connection->client);
|
|
||||||
#endif /*APACHE_XLATE*/
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1306,11 +1289,6 @@ request_rec *ap_read_request(conn_rec *conn)
|
|||||||
r->output_filters = conn->output_filters;
|
r->output_filters = conn->output_filters;
|
||||||
r->input_filters = conn->input_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,
|
ap_bsetopt(conn->client, BO_TIMEOUT,
|
||||||
conn->keptalive
|
conn->keptalive
|
||||||
? &r->server->keep_alive_timeout
|
? &r->server->keep_alive_timeout
|
||||||
@@ -1704,11 +1682,6 @@ AP_DECLARE(void) ap_basic_http_header(request_rec *r)
|
|||||||
protocol = AP_SERVER_PROTOCOL;
|
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 */
|
/* Output the HTTP/1.x Status-Line and the Date and Server fields */
|
||||||
|
|
||||||
(void) checked_bputstrs(r, protocol, " ", r->status_line, CRLF, NULL);
|
(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, "Date"); /* Avoid bogosity */
|
||||||
apr_table_unset(r->headers_out, "Server");
|
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
|
/* 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);
|
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);
|
ap_set_keepalive(r);
|
||||||
|
|
||||||
if (r->chunked) {
|
if (r->chunked) {
|
||||||
@@ -2211,9 +2176,6 @@ AP_DECLARE(void) ap_send_http_header(request_rec *r)
|
|||||||
if (r->chunked) {
|
if (r->chunked) {
|
||||||
ap_bsetflag(r->connection->client, B_CHUNK, 1);
|
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
|
/* 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;
|
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;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1451,11 +1451,6 @@ static request_rec *internal_internal_redirect(const char *new_uri,
|
|||||||
return NULL;
|
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;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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;
|
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*/
|
#endif /*APACHE_XLATE*/
|
||||||
|
Reference in New Issue
Block a user