]> granicus.if.org Git - apache/commitdiff
Change the content-length filter to give up (i.e., not provide content-length)
authorJeff Trawick <trawick@apache.org>
Fri, 3 Nov 2000 16:38:28 +0000 (16:38 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 3 Nov 2000 16:38:28 +0000 (16:38 +0000)
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

modules/http/http_protocol.c

index b57fc1738d0166a0bd8bcd6ffb5ce2f0f31540fd..a3aa5db38fe1f5b8e398d8eec30bf54ca94f7911 100644 (file)
@@ -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
      */