* 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
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 */
/* 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;
}
}
/* 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");