]> granicus.if.org Git - apache/commitdiff
get basic HTTP proxy working on EBCDIC machines
authorJeff Trawick <trawick@apache.org>
Fri, 26 Apr 2002 12:29:38 +0000 (12:29 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 26 Apr 2002 12:29:38 +0000 (12:29 +0000)
(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
modules/proxy/mod_proxy.h
modules/proxy/proxy_http.c

diff --git a/CHANGES b/CHANGES
index 6d195b1e54ae35aee07f4ee1b94ab25c6be7b3db..b81f1de4c679ac13cce8e96eddf413cdbcbf34b2 100644 (file)
--- 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]
 
index e560e984938442bb77447fa4d5afab240cd376df..5e5fabfab8a05a2bdf3710f8753037dd03216dbe 100644 (file)
 #include "http_log.h"
 #include "http_connection.h"
 #include "util_filter.h"
+#include "util_ebcdic.h"
 
 #if APR_HAVE_NETINET_IN_H
 #include <netinet/in.h>
index d7392d35ccfeb41d15ae725a019ed78659be2a3e..c5d0451d88ab3d82f32a33de9c5a913081035d9d 100644 (file)
@@ -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);