On Sun, 19 Sep 2004, Joe Schaefer wrote:
> Index: modules/loggers/mod_logio.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/modules/loggers/mod_logio.c,v
> retrieving revision 1.8
> diff -u -r1.8 mod_logio.c
> --- modules/loggers/mod_logio.c 3 Apr 2004 20:50:00 -0000 1.8
> +++ modules/loggers/mod_logio.c 19 Sep 2004 23:31:33 -0000
> @@ -127,8 +127,12 @@
>
> /* End of data, make sure we flush */
> if (APR_BUCKET_IS_EOS(b)) {
> - APR_BUCKET_INSERT_BEFORE(b,
> - apr_bucket_flush_create(f->c->bucket_alloc));
> + apr_bucket *flush = apr_bucket_flush_create(f->c->bucket_alloc);
> +
> + if (b != APR_BRIGADE_FIRST(bb))
> + APR_BUCKET_INSERT_BEFORE(b, flush);
> + else
> + APR_BRIGADE_INSERT_HEAD(bb, flush);
> }
>
> return ap_pass_brigade(f->next, bb);
Zuh? This is completely unnecessary. The only time inserting can corrupt
a brigade is if the bucket being inserted is still on some other brigade
(ie, you're inserting it onto brigade b before removing it from brigade
a). In this case, the bucket being inserted is freshly created, so
there's no problem at all. There must be some other problem.
--Cliff