summaryrefslogtreecommitdiffstats
path: root/modules/proxy/proxy_http.c
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2004-12-30 17:31:13 +0100
committerJeff Trawick <trawick@apache.org>2004-12-30 17:31:13 +0100
commitd2c60589c6bdd69a138a07497f94c4942218ba1e (patch)
tree0d8ce562eeb095ecebbea8a5a3315ef869943010 /modules/proxy/proxy_http.c
parentAs per bug 22061, this paragraph predates RedirectMatch, and is thus (diff)
downloadapache2-d2c60589c6bdd69a138a07497f94c4942218ba1e.tar.xz
apache2-d2c60589c6bdd69a138a07497f94c4942218ba1e.zip
mod_proxy: Fix a request corruption problem and a buffering problem
which sometimes prevented proxy-sendchunks from working. strlen() couldn't be used since no space had been allocated for trailing NUL, so occasionally the T-E header field contained garbage and a 400 error would be returned by the origin server. The lack of a flush bucket after the final "0\r\n\r\n" was a showstopper for my simple tests (reverse proxy to Apache 1.3 + custom module which read the body). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--modules/proxy/proxy_http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c
index 2fc10c17ae..062dad1026 100644
--- a/modules/proxy/proxy_http.c
+++ b/modules/proxy/proxy_http.c
@@ -467,7 +467,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
buf = apr_pmemdup(p, te_hdr, sizeof(te_hdr)-1);
ap_xlate_proto_to_ascii(buf, sizeof(te_hdr)-1);
- e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
+ e = apr_bucket_pool_create(buf, sizeof(te_hdr)-1, p, c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(header_brigade, e);
}
else {
@@ -587,6 +587,8 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
/* <trailers> */
ASCII_CRLF, 5, c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(body_brigade, e);
+ e = apr_bucket_flush_create(c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(body_brigade, e);
}
if (!send_chunks) {