From: Martin Kraemer Date: Thu, 11 Apr 2002 19:40:50 +0000 (+0000) Subject: Fix the new dechunking code for S/390 (EBCDIC). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a4c579db6546f3f204dba10950ced0c2e4ff704;p=thirdparty%2Fapache%2Fhttpd.git Fix the new dechunking code for S/390 (EBCDIC). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94604 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/modules/proxy/proxy_http.c b/src/modules/proxy/proxy_http.c index 05c8ef685d8..bb32db72ead 100644 --- a/src/modules/proxy/proxy_http.c +++ b/src/modules/proxy/proxy_http.c @@ -586,6 +586,7 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url, * What we read/write after the header should not be modified (i.e., the * cache copy is ASCII, not EBCDIC, even for text/html) */ + r->ebcdic.conv_in = r->ebcdic.conv_out = 0; ap_bsetflag(f, B_ASCII2EBCDIC | B_EBCDIC2ASCII, 0); ap_bsetflag(r->connection->client, B_ASCII2EBCDIC | B_EBCDIC2ASCII, 0); #endif diff --git a/src/modules/proxy/proxy_util.c b/src/modules/proxy/proxy_util.c index 1c43bc21bdf..22e72e837a6 100644 --- a/src/modules/proxy/proxy_util.c +++ b/src/modules/proxy/proxy_util.c @@ -453,7 +453,7 @@ long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c, off_t len, int size_t buf_size; size_t remaining = 0; long total_bytes_rcvd; - register int n, o, w; + register int n = 0, o, w; conn_rec *con = r->connection; int alternate_timeouts = 1; /* 1 if we alternate between soft & hard * timeouts */ @@ -553,13 +553,17 @@ long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c, off_t len, int /* soak up trailing CRLF */ if (0 == remaining) { char ch; -/****/ -/* XXXX FIXME: Does this little "soak CRLF" work with EBCDIC???? */ -/****/ - if ((ch = ap_bgetc(f)) == CR) { + /* + * For EBCDIC, the proxy has configured the BUFF layer to + * transparently pass the ascii characters thru (also writing + * an ASCII copy to the cache, where appropriate). + * Therefore, we see here an ASCII-CRLF (\015\012), + * not an EBCDIC-CRLF (\r\n). + */ + if ((ch = ap_bgetc(f)) == '\015') { /* _ASCII_ CR */ ch = ap_bgetc(f); } - if (ch != LF) { + if (ch != '\012') { n = -1; } } @@ -1476,6 +1480,16 @@ void ap_proxy_clear_connection(pool *p, table *headers) /* unset hop-by-hop headers defined in RFC2616 13.5.1 */ ap_table_unset(headers,"Keep-Alive"); + /* + * XXX: @@@ FIXME: "Proxy-Authenticate" should IMO *not* be stripped + * because in a chain of proxies some "front" proxy might need + * proxy authentication, while a "back-end" proxy which needs none can + * simply pass the "Proxy-Authenticate" back to the client, and pass + * the client's "Proxy-Authorization" to the front-end proxy. + * (See the note in proxy_http.c for the "Proxy-Authorization" case.) + * + * MnKr 04/2002 + */ ap_table_unset(headers,"Proxy-Authenticate"); ap_table_unset(headers,"TE"); ap_table_unset(headers,"Trailer");