]> granicus.if.org Git - apache/commitdiff
A couple of optimizations to the content_length filter.
authorBill Stoddard <stoddard@apache.org>
Tue, 24 Jul 2001 21:33:44 +0000 (21:33 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 24 Jul 2001 21:33:44 +0000 (21:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89684 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index b6c1b95733b8028bba0b01d213124295ead27c20..b8ec3cc6ab67df7b1f163ef044b66a18b1b14ac6 100644 (file)
@@ -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;
                 }
             }