From: Jeff Trawick Date: Wed, 5 Jan 2005 15:25:12 +0000 (+0000) Subject: the check for EOS isn't going to work if we already X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fa15d74f14c5ab7218c556c40fef1bd72514332;p=thirdparty%2Fapache%2Fhttpd.git the check for EOS isn't going to work if we already deleted the eos; we ended up sending the last piece of data from the client twice; I had (poorly) modified the EOS section from the normal idiom to keep from having to deal with the EOS later when reusing the input brigade git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/proxy-reqbody@124220 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index e11336dae6d..c0038557cd9 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -335,16 +335,16 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p, if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) { seen_eos = 1; - /* We can't pass this EOS to the output_filters. */ - e = APR_BRIGADE_LAST(input_brigade); - apr_bucket_delete(e); - /* 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); } apr_brigade_length(input_brigade, 1, &bytes); @@ -392,6 +392,10 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p, b = header_brigade; } else { + /* input brigade still has an EOS which we can't pass to the output_filters. */ + e = APR_BRIGADE_LAST(input_brigade); + AP_DEBUG_ASSERT(APR_BUCKET_IS_EOS(e)); + apr_bucket_delete(e); e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF /* */ ASCII_CRLF,