From 80692df384661b13ca5621e3c83ae3ba1bc3b9cb Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 24 Jul 2001 21:33:44 +0000 Subject: [PATCH] A couple of optimizations to the content_length filter. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89684 13f79535-47bb-0310-9956-ffa450edef68 --- server/protocol.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/server/protocol.c b/server/protocol.c index b6c1b95733..b8ec3cc6ab 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -888,26 +888,25 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f, APR_BRIGADE_FOREACH(e, b) { const char *ignored; apr_size_t len; - /* If we've accumulated more than 4xAP_MIN_BYTES_TO_WRITE and - * the client supports chunked encoding, send what we have - * and come back for more. - */ - if ((ctx->curr_len > 4*AP_MIN_BYTES_TO_WRITE) && partial_send_okay) { - split = b; - more = apr_brigade_split(b, e); - break; - } len = 0; if (APR_BUCKET_IS_EOS(e)) { eos = 1; } else if (APR_BUCKET_IS_FLUSH(e)) { + if (partial_send_okay) { + split = b; + more = apr_brigade_split(b, APR_BUCKET_NEXT(e)); + break; + } + } + else if ((ctx->curr_len > 4*AP_MIN_BYTES_TO_WRITE)) { + /* If we've accumulated more than 4xAP_MIN_BYTES_TO_WRITE and + * the client supports chunked encoding, send what we have + * and come back for more. + */ if (partial_send_okay) { split = b; more = apr_brigade_split(b, e); - /* Remove the flush bucket from brigade 'more' */ - APR_BUCKET_REMOVE(e); - flush = 1; break; } } -- 2.40.0