httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Filter recieves only EOF buckets
Date Mon, 23 Apr 2007 06:17:34 GMT

Mike <> 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_POOL(b)) return "POOL";
	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);
			//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

View raw message