From: Jeff Trawick Date: Fri, 3 Nov 2000 16:38:28 +0000 (+0000) Subject: Change the content-length filter to give up (i.e., not provide content-length) X-Git-Tag: APACHE_2_0_ALPHA_8~174 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdfcc2df5a558c502ad164010444fa3104621387;p=apache Change the content-length filter to give up (i.e., not provide content-length) if it gets a flush bucket. A generator of streaming content needs to send down a flush bucket (e.g., by calling ap_rflush()) if it wants to send a partial response to the client immediately. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86826 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index b57fc1738d..a3aa5db38f 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2298,6 +2298,19 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f, return ap_pass_brigade(f->next, b); } + /* check for flush bucket... if there is one, we have to scratch + * the idea of providing content length because the output should + * flow immediately (for streaming dynamic content) + */ + + AP_BRIGADE_FOREACH(e, b) { + if (AP_BUCKET_IS_FLUSH(e)) { + AP_BRIGADE_CONCAT(ctx->saved, b); + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, ctx->saved); + } + } + /* save the brigade; we can't pass any data to the next * filter until we have the entire content length */