From: Jim Jagielski Date: Mon, 12 Jan 2009 14:03:38 +0000 (+0000) Subject: Merge r732832, r733134, r733218 from trunk: X-Git-Tag: 2.2.12~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30f4e49aaf4500f4f82ead417bd6a2776a6342e5;p=thirdparty%2Fapache%2Fhttpd.git Merge r732832, r733134, r733218 from trunk: Translate locally generated "100-Continue" message to ASCII on EBCDIC systems. EBCDIC fix for ap_send_interim_response() simplifications per niq's review comments Submitted by: covener Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@733759 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 199f3e72b8f..6db07524572 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.12 + *) core: Translate the the status line to ASCII on EBCDIC platforms in + ap_send_interim_response() and for locally generated "100 Continue" + responses. [Eric Covener] + *) CGI: return 504 (Gateway timeout) rather than 500 when a script times out before returning status line/headers. PR 42190 [Nick Kew] diff --git a/STATUS b/STATUS index 302bf1b9d38..9c0eee855c3 100644 --- a/STATUS +++ b/STATUS @@ -103,17 +103,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: trunk works +1 covener, rpluem, niq - * core: Translate locally generated "100-Continue" messages to ASCII - on EBCDIC systems, and translate the status_line on the way out of - ap_send_interim_response(). - trunk: - http://svn.apache.org/viewvc?rev=732832&view=rev - http://svn.apache.org/viewvc?rev=733134&view=rev - http://svn.apache.org/viewvc?rev=733218&view=rev - 2.2.x: - trunk works - +1 covener, niq, rpluem - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 89263d4dcb6..f7f86df479b 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -329,11 +329,14 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ctx->eos_sent = 1; } else { char *tmp; + int len; tmp = apr_pstrcat(f->r->pool, AP_SERVER_PROTOCOL, " ", ap_get_status_line(100), CRLF CRLF, NULL); + len = strlen(tmp); + ap_xlate_proto_to_ascii(tmp, len); apr_brigade_cleanup(bb); - e = apr_bucket_pool_create(tmp, strlen(tmp), f->r->pool, + e = apr_bucket_pool_create(tmp, len, f->r->pool, f->c->bucket_alloc); APR_BRIGADE_INSERT_HEAD(bb, e); e = apr_bucket_flush_create(f->c->bucket_alloc); diff --git a/server/protocol.c b/server/protocol.c index e5b2e030db9..23ef080f4bc 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -1643,6 +1643,7 @@ static int send_header(void *data, const char *key, const char *val) AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers) { hdr_ptr x; + char *status_line = NULL; if (r->proto_num < 1001) { /* don't send interim response to HTTP/1.0 Client */ @@ -1654,9 +1655,13 @@ AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers) return; } + status_line = apr_pstrcat(r->pool, AP_SERVER_PROTOCOL, " ", r->status_line, CRLF, NULL); + ap_xlate_proto_to_ascii(status_line, strlen(status_line)); + x.f = r->connection->output_filters; x.bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); - ap_fputstrs(x.f, x.bb, AP_SERVER_PROTOCOL, " ", r->status_line, CRLF, NULL); + + ap_fputs(x.f, x.bb, status_line); if (send_headers) { apr_table_do(send_header, &x, r->headers_out, NULL); apr_table_clear(r->headers_out);