From: Eric Covener Date: Wed, 4 Jan 2017 18:04:26 +0000 (+0000) Subject: old IBM EBCDIC fix that never got shared. X-Git-Tag: 2.5.0-alpha~817 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2fb7e185c6f50fa8906bc9b872bad8771dd281e;p=thirdparty%2Fapache%2Fhttpd.git old IBM EBCDIC fix that never got shared. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777354 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index edea266b897..97ee6341852 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) core: EBCDIC fixes for interim responses with additional headers. + [Eric Covener] + *) mod_http2: fix for possible page fault when stream is resumed during session shutdown. [sidney-j-r-m (github)] diff --git a/server/protocol.c b/server/protocol.c index 410da0f1419..8cf5a7d48d7 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -2080,12 +2080,26 @@ typedef struct hdr_ptr { apr_bucket_brigade *bb; } hdr_ptr; + +#if APR_CHARSET_EBCDIC static int send_header(void *data, const char *key, const char *val) { - ap_fputstrs(((hdr_ptr*)data)->f, ((hdr_ptr*)data)->bb, - key, ": ", val, CRLF, NULL); + char *header_line = NULL; + hdr_ptr *hdr = (hdr_ptr*)data; + + header_line = apr_pstrcat(hdr->bb->p, key, ": ", val, CRLF, NULL); + ap_xlate_proto_to_ascii(header_line, strlen(header_line)); + ap_fputs(hdr->f, hdr->bb, header_line); return 1; } +#else +static int send_header(void *data, const char *key, const char *val) +{ + ap_fputstrs(((hdr_ptr*)data)->f, ((hdr_ptr*)data)->bb, + key, ": ", val, CRLF, NULL); + return 1; + } +#endif AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers) {