From: Jeff Trawick Date: Mon, 10 Jan 2005 16:15:34 +0000 (+0000) Subject: don't flush more than is necessary; this change keeps us X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=853ffd21c6e4ef00e639d733eb5689ef8e2f2415;p=thirdparty%2Fapache%2Fhttpd.git don't flush more than is necessary; this change keeps us from writing small packets to the origin server when we're streaming the request body git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/proxy-reqbody@124807 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 1e173d68896..b24e7661fd2 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -380,7 +380,7 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p, b = input_brigade; } - status = pass_brigade(bucket_alloc, r, conn, origin, b, 1); + status = pass_brigade(bucket_alloc, r, conn, origin, b, 0); if (status != APR_SUCCESS) { return status; } @@ -466,7 +466,7 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, b = input_brigade; } - status = pass_brigade(bucket_alloc, r, conn, origin, b, 1); + status = pass_brigade(bucket_alloc, r, conn, origin, b, 0); if (status != APR_SUCCESS) { return status; } @@ -481,10 +481,15 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, add_cl(p, bucket_alloc, header_brigade, old_cl_val); } terminate_headers(bucket_alloc, header_brigade); - status = pass_brigade(bucket_alloc, r, conn, origin, header_brigade, 1); - if (status != APR_SUCCESS) { - return status; - } + b = header_brigade; + } + else { + /* need to flush any pending data */ + b = input_brigade; /* empty now; pass_brigade() will add flush */ + } + status = pass_brigade(bucket_alloc, r, conn, origin, b, 1); + if (status != APR_SUCCESS) { + return status; } return APR_SUCCESS;