summaryrefslogtreecommitdiffstats
path: root/modules/proxy
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2001-10-14 22:41:00 +0200
committerJustin Erenkrantz <jerenkrantz@apache.org>2001-10-14 22:41:00 +0200
commite1438a2d7c487c8a2ca22b719527835fc6067186 (patch)
tree625e621607c10b5aaf533c3973aa937da5d80314 /modules/proxy
parentEnsure that ap_http_filter can not be coersced into reading more than we (diff)
downloadapache2-e1438a2d7c487c8a2ca22b719527835fc6067186.tar.xz
apache2-e1438a2d7c487c8a2ca22b719527835fc6067186.zip
Fix the first bucket not getting chunked properly. The reason was that
we left the TE header in the output headers, so ap_set_keepalive didn't set r->chunked to 1. So, ap_http_header_filter wouldn't insert CHUNK filter appropriately. I have no clue how it chunked anything at all before this patch, but hey, it looks right now. Tested with Yahoo, Apple, apache.org, and /. /. is interesting in that it sends both Conn: Close and TE: chunked. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91463 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy')
-rw-r--r--modules/proxy/proxy_http.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c
index 87d39fb2ed..0ede23f30a 100644
--- a/modules/proxy/proxy_http.c
+++ b/modules/proxy/proxy_http.c
@@ -792,13 +792,18 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
(r->status != HTTP_RESET_CONTENT) && /* not 205 */
(r->status != HTTP_NOT_MODIFIED)) { /* not 304 */
- const char *buf;
- if (ap_proxy_liststr((buf = apr_table_get(r->headers_out,
- "Transfer-Encoding")), "chunked")) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
- "proxy: Transfer-Encoding Chunked!");
- apr_table_unset(r->headers_out,"Content-Length");
- }
+ /* We need to copy the output headers and treat them as input
+ * headers as well. BUT, we need to do this before we remove
+ * TE and C-L, so that they are preserved accordingly for
+ * ap_http_filter to know where to end.
+ */
+ rp->headers_in = apr_table_copy(r->pool, r->headers_out);
+
+ /* In order for ap_set_keepalive to work properly, we can NOT
+ * have any length information stored in the output headers.
+ */
+ apr_table_unset(r->headers_out,"Transfer-Encoding");
+ apr_table_unset(r->headers_out,"Content-Length");
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: start body send");
@@ -811,7 +816,6 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
/* read the body, pass it to the output filters */
apr_off_t readbytes;
apr_bucket *e;
- rp->headers_in = r->headers_out;
readbytes = AP_IOBUFSIZE;
while (ap_get_brigade(rp->input_filters,
bb,