From 2c9f05f0885e9ae4b5a2ae78c52605d7f2defd70 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 26 Apr 2002 12:29:38 +0000 Subject: [PATCH] get basic HTTP proxy working on EBCDIC machines (I would bet that there is more work to do throughout proxy, but at least it can serve some pages now) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94811 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ modules/proxy/mod_proxy.h | 1 + modules/proxy/proxy_http.c | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 6d195b1e54..b81f1de4c6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with Apache 2.0.37 + *) Get basic HTTP proxy working on EBCDIC machines. [Jeff Trawick] + *) Allow mod_unique_id to work on systems with no IPv4 address corresponding to their host name. [Jeff Trawick] diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index e560e98493..5e5fabfab8 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -108,6 +108,7 @@ #include "http_log.h" #include "http_connection.h" #include "util_filter.h" +#include "util_ebcdic.h" #if APR_HAVE_NETINET_IN_H #include diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index d7392d35cc..c5d0451d88 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -451,6 +451,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, } buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.1" CRLF, NULL); + ap_xlate_proto_to_ascii(buf, strlen(buf)); e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); if ( conf->preserve_host == 0 ) { @@ -477,6 +478,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, } buf = apr_pstrcat(p, "Host: ", hostname, CRLF, NULL); } + ap_xlate_proto_to_ascii(buf, strlen(buf)); e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); @@ -593,12 +595,17 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, buf = apr_pstrcat(p, headers_in[counter].key, ": ", headers_in[counter].val, CRLF, NULL); + ap_xlate_proto_to_ascii(buf, strlen(buf)); e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); } /* add empty line at the end of the headers */ +#if APR_CHARSET_EBCDIC + e = apr_bucket_immortal_create("\015\012", 2, c->bucket_alloc); +#else e = apr_bucket_immortal_create(CRLF, sizeof(CRLF)-1, c->bucket_alloc); +#endif APR_BRIGADE_INSERT_TAIL(bb, e); e = apr_bucket_flush_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); -- 2.40.0