httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rici Lake <r...@ricilake.net>
Subject Proposed patch: always cleanup brigades in ap_pass_brigade
Date Mon, 25 Apr 2005 17:47:40 GMT
Regardless of any other changes to the brigade API, this seems to me to 
be a good idea:

Index: util_filter.c
===================================================================
--- util_filter.c       (revision 158730)
+++ util_filter.c       (working copy)
@@ -500,6 +500,7 @@
  AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next,
                                           apr_bucket_brigade *bb)
  {
+    apr_status_t result = AP_NOBODY_WROTE;
      if (next) {
          apr_bucket *e;
          if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) && 
next->r) {
@@ -523,9 +524,10 @@
                  }
              }
          }
-        return next->frec->filter_func.out_func(next, bb);
+        result = next->frec->filter_func.out_func(next, bb);
+        apr_brigade_cleanup(bb);
      }
-    return AP_NOBODY_WROTE;
+    return result;
  }

  AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f,



Index: util_filter.h
===================================================================
--- util_filter.h       (revision 158730)
+++ util_filter.h       (working copy)
@@ -299,7 +299,8 @@
   * Pass the current bucket brigade down to the next filter on the 
filter
   * stack.  The filter returns an apr_status_t value.  If the 
bottom-most
   * filter doesn't write to the network, then ::AP_NOBODY_WROTE is 
returned.
- * The caller relinquishes ownership of the brigade.
+ * The caller retains ownership of the brigade. The brigade will be
+ * empty on return.
   * @param filter The next filter in the chain
   * @param bucket The current bucket brigade
   */


Mime
View raw message