]> granicus.if.org Git - apache/commitdiff
stop using APR_BRIGADE_NORMALIZE()
authorJeff Trawick <trawick@apache.org>
Sun, 17 Feb 2002 19:21:31 +0000 (19:21 +0000)
committerJeff Trawick <trawick@apache.org>
Sun, 17 Feb 2002 19:21:31 +0000 (19:21 +0000)
(okay, making a copy of it is cheating perhaps, but the name of the
game is to get APR_BRIGADE_NORMALIZE() out of the API)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93458 13f79535-47bb-0310-9956-ffa450edef68

STATUS
server/core.c

diff --git a/STATUS b/STATUS
index c65640d11e7d7d95b9ffda2bd580c25105a8cdb1..268deb878f17845fcb101debdead0212bd75a1d2 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2002/02/17 07:09:00 $]
+Last modified at [$Date: 2002/02/17 19:21:31 $]
 
 Release:
 
@@ -74,10 +74,6 @@ FINAL RELEASE SHOWSTOPPERS:
     * API changes planned for 2.0 that should happen before the
       GA release:
           * Free lists for bucket allocation
-          * Removal of APR_BRIGADE_NORMALIZE from the public bucket API
-      Justin says: "APR_BRIGADE_NORMALIZE is not a showstopper since no
-                    one uses it except for core_input_filter.  If its
-                    use was prevalent, that'd be a different story."
 
 CURRENT VOTES:
 
index 95e4f101911d6735c177d9cdf6dae895e1ef748c..0b7a0f975d43b25d0253068ef8347a3e3d808c26 100644 (file)
@@ -3026,6 +3026,23 @@ static int net_time_filter(ap_filter_t *f, apr_bucket_brigade *b,
     return ap_get_brigade(f->next, b, mode, block, readbytes);
 }
 
+/**
+ * Remove all zero length buckets from the brigade.
+ */
+#define BRIGADE_NORMALIZE(b)       \
+do { \
+    apr_bucket *e = APR_BRIGADE_FIRST(b); \
+    do {  \
+        if (e->length == 0) { \
+            apr_bucket *d; \
+            d = APR_BUCKET_NEXT(e); \
+            apr_bucket_delete(e); \
+            e = d; \
+        } \
+        e = APR_BUCKET_NEXT(e); \
+    } while (!APR_BRIGADE_EMPTY(b) && (e != APR_BRIGADE_SENTINEL(b))); \
+} while (0)
+
 static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, 
                              ap_input_mode_t mode, apr_read_type_e block,
                              apr_off_t readbytes)
@@ -3066,9 +3083,9 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
     }
     
     /* ### This is bad. */
-    APR_BRIGADE_NORMALIZE(ctx->b);
+    BRIGADE_NORMALIZE(ctx->b);
 
-    /* check for empty brigade again *AFTER* APR_BRIGADE_NORMALIZE()
+    /* check for empty brigade again *AFTER* BRIGADE_NORMALIZE()
      * If we have lost our socket bucket (see above), we are EOF.
      *
      * Ideally, this should be returning SUCCESS with EOS bucket, but