From: William A. Rowe Jr Date: Mon, 8 Aug 2005 03:01:39 +0000 (+0000) Subject: Backport r230735, we need not look at the first bucket for EOS, X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29ed02d8b309f07421ad9bde2d542e4f0fdc566d;p=thirdparty%2Fapache%2Fhttpd.git Backport r230735, we need not look at the first bucket for EOS, because the outer while loop protected us from that case. Backport the header brigade changes as it's impossible to have a body request waiting for a final send. Look at seen_eos to flush us in the request body loop, and handle the only exception, (header_brigade), outside of that loop. This brings stream_reqbody_cl in sync with the trunk. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/proxy-reqbody-2.0.x@230736 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index e39cbaad33e..e1dc93f19c8 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -586,13 +586,6 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) { seen_eos = 1; - /* As a shortcut, if this brigade is simply an EOS bucket, - * don't send anything down the filter chain. - */ - if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(input_brigade))) { - break; - } - /* We can't pass this EOS to the output_filters. */ e = APR_BRIGADE_LAST(input_brigade); apr_bucket_delete(e); @@ -622,7 +615,8 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, b = input_brigade; } - status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 0); + /* Once we hit EOS, we are ready to flush. */ + status = pass_brigade(bucket_alloc, r, p_conn, origin, b, seen_eos); if (status != APR_SUCCESS) { return status; } @@ -649,15 +643,11 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, if (header_brigade) { /* we never sent the header brigade since there was no request - * body; send it now + * body; send it now with the flush flag */ b = header_brigade; + status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1); } - else { - /* need to flush any pending data */ - b = input_brigade; /* empty now; pass_brigade() will add flush */ - } - status = pass_brigade(bucket_alloc, r, p_conn, origin, b, 1); return status; }