From: Martin Kraemer Date: Fri, 31 Aug 2007 08:40:14 +0000 (+0000) Subject: proxy/ajp_header.c: Backport of an AJP protocol fix for EBCDIC X-Git-Tag: 2.2.6~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9b03772bf07201680d445188519e861b1ebf968;p=thirdparty%2Fapache%2Fhttpd.git proxy/ajp_header.c: Backport of an AJP protocol fix for EBCDIC On EBCDIC machines, the status_line string was incorrectly converted twice. Based on trunk revisions 357022 and 357699. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@571402 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 66d815503cd..e962e641f01 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.6 + *) proxy/ajp_header.c: Backport of an AJP protocol fix for EBCDIC + On EBCDIC machines, the status_line string was incorrectly converted + twice. [Jean-Frederic Clere, Martin Kraemer] (based on rev. 357022) + *) mod_dumpio: Fix for correct dumping of traffic on EBCDIC hosts Data had been incorrectly converted twice, resulting in garbled log output. [Martin Kraemer] diff --git a/STATUS b/STATUS index 3e59c9532ee..110acecc17f 100644 --- a/STATUS +++ b/STATUS @@ -226,14 +226,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK: http://svn.apache.org/viewvc?rev=571232&view=rev +1: jim,martin,rpluem - * proxy/ajp_header.c: EBCDIC: backport of rev. 357022, fixing the AJP protocol. - An EBCDIC decimal string prefix was incorrectly - converted "again" to EBCDIC. - Trunk version of patch: - http://svn.apache.org/viewvc?rev=357022&view=rev - Had already been committed as Rev. 571209 (but was reverted again) - http://svn.apache.org/viewvc?rev=571209&view=rev - +1: martin,jim,rpluem PATCHES/ISSUES THAT ARE STALLED diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index a72d47a55e1..11ef8896b47 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -473,10 +473,11 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, rc = ajp_msg_get_string(msg, &ptr); if (rc == APR_SUCCESS) { - r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr); -#if defined(AS400) || defined(_OSD_POSIX) - ap_xlate_proto_from_ascii(r->status_line, strlen(r->status_line)); +#if defined(AS400) || defined(_OSD_POSIX) /* EBCDIC platforms */ + ptr = apr_pstrdup(r->pool, ptr); + ap_xlate_proto_from_ascii(ptr, strlen(ptr)); #endif + r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr); } else { r->status_line = NULL; }