]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix the new dechunking code for S/390 (EBCDIC).
authorMartin Kraemer <martin@apache.org>
Thu, 11 Apr 2002 19:40:50 +0000 (19:40 +0000)
committerMartin Kraemer <martin@apache.org>
Thu, 11 Apr 2002 19:40:50 +0000 (19:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94604 13f79535-47bb-0310-9956-ffa450edef68

src/modules/proxy/proxy_http.c
src/modules/proxy/proxy_util.c

index 05c8ef685d8e4d05d334a0b471222823f5700462..bb32db72ead3dc1096d26fb1d43ee0ab851b3227 100644 (file)
@@ -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
index 1c43bc21bdf0388559c4a8b0a190280ee782e356..22e72e837a6cc89f1d029e1f896319bc72137bc9 100644 (file)
@@ -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");