On Fri, 31 May 2002, Ryan Bloom wrote:
> > > - if (AP_BUCKET_IS_ERROR(e)) {
> > > - apr_bucket *err_copy;
> > > - apr_bucket_copy(e, &err_copy);
> > > - APR_BRIGADE_INSERT_TAIL(ctx->bb, err_copy);
> > > + if (e->length == 0) {
> >
> > Looks like magic to me - perhaps wrap it in AP_BUCKET_IS_METADATA()?
>
> ++1! This question actually came up on IRC yesterday as well, and I
> told Justin that it was absolutely required. I hope to do the work
> later today unless somebody beats me to it. :-)
-1.
e->length == 0 does NOT imply it *has* to be metadata. It could just be a
data bucket that's empty. On the other hand, if it's metadata that DOES
imply e->length == 0. It's a one-way relationship, not an if-and-only-if.
It turns out that most filters won't much care... if they act on data in a
bucket and the bucket contains no data, they should just pass it on along.
But it could easily be an empty HEAP bucket, and that's definitely not a
metadata bucket. If you're going to have an APR_BUCKET_IS_METADATA()
macro, it will have to test a new "ismetadata" flag in the
apr_bucket_type_t. But I'm -0.5 to that too, because it leads filter
authors to believe that there should be a distinction between metadata
buckets and empty data buckets when that's not the case.
--Cliff