Mike <[EMAIL PROTECTED]> wrote 23.04.2007 00:29:38:
> Show us main bucket brigade loop and hook function. Probably you forgot
> to insert the filter or smth...
>
It is just a debugging loop atm. And the loop body only gets called once, and
there EOS bucket in it.
When I ignore he sentinel bucket, and go on anyway, all that is in the brigade
are alternating EOS and METADATA buckets.
And the filter definitely gets inserted. Since it gets called. And it also only
gets inserted when I want it inserted, since it only gets called then.
static const char* buckettype(apr_bucket *b)
{
if(APR_BUCKET_IS_FLUSH(b)) return "FLUSH";
if(APR_BUCKET_IS_EOS(b)) return "EOS";
if(APR_BUCKET_IS_FILE(b)) return "FILE";
if(APR_BUCKET_IS_PIPE(b)) return "PIPE";
if(APR_BUCKET_IS_HEAP(b)) return "HEAP";
if(APR_BUCKET_IS_MMAP(b)) return "MMAP";
if(APR_BUCKET_IS_IMMORTAL(b)) return "IMMORTAL";
if(APR_BUCKET_IS_TRANSIENT(b)) return "TRANSIENT";
if(APR_BUCKET_IS_POOL(b)) return "POOL";
if(APR_BUCKET_IS_METADATA(b)) return "METADATA";
return "unknown";
}
static int main_filter_hook(ap_filter_t *f, apr_bucket_brigade *bb)
{
apr_bucket *b = APR_BRIGADE_FIRST(bb);
ap_filter_t *tf = f->r->output_filters;
while (b != APR_BRIGADE_SENTINEL(bb))
{
//ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, f->r,
"filter: %s", tf->frec->name);
//if(!tf->next)break;
//else tf = tf->next;
ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, f->r, "type:
%s", buckettype(b));
b = APR_BUCKET_NEXT(b);
}
return ap_pass_brigade(f->next, bb);
}
Jan Schukat