Should the filters mentioned above use apr_brigade_cleanup() instead? e.g. what happens if a handler uses ap_brigade_pass() to pass a brigade to a filter, say mod_ext_filter, and then calls apr_brigade_cleanup() and reuses the brigade? The brigade will already have been destroyed by mod_ext_filter, won't it?
The caller of ap_pass_brigade() relinquishes its interest in the brigade. The usual case is for the core output filter (server/core.c) to do the destroy, though occasionally some other filter will do that.
Index: include/util_filter.h =================================================================== RCS file: /home/cvs/httpd-2.0/include/util_filter.h,v retrieving revision 1.79 diff -u -r1.79 util_filter.h --- include/util_filter.h 22 Aug 2003 20:40:13 -0000 1.79 +++ include/util_filter.h 23 Nov 2003 16:07:47 -0000 @@ -318,6 +318,7 @@ * 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. * @param filter The next filter in the chain * @param bucket The current bucket brigade */
