brianp 2002/12/22 16:16:48
Modified: buckets apr_brigade.c
Log:
put the old pool-based brigade allocation back in place for httpd-2.0.44
release
Revision Changes Path
1.56 +7 -12 apr-util/buckets/apr_brigade.c
Index: apr_brigade.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_brigade.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- apr_brigade.c 17 Dec 2002 19:16:39 -0000 1.55
+++ apr_brigade.c 23 Dec 2002 00:16:48 -0000 1.56
@@ -85,18 +85,16 @@
e = APR_BRIGADE_FIRST(b);
apr_bucket_delete(e);
}
+ /*
+ * We don't need to free(bb) because it's allocated from a pool.
+ */
return APR_SUCCESS;
}
APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b)
{
- apr_status_t rv;
- if (b->p) {
- apr_pool_cleanup_kill(b->p, b, brigade_cleanup);
- }
- rv = apr_brigade_cleanup(b);
- apr_bucket_free(b);
- return rv;
+ apr_pool_cleanup_kill(b->p, b, brigade_cleanup);
+ return apr_brigade_cleanup(b);
}
APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p,
@@ -104,16 +102,13 @@
{
apr_bucket_brigade *b;
- b = apr_bucket_alloc(sizeof(*b), list);
+ b = apr_palloc(p, sizeof(*b));
b->p = p;
b->bucket_alloc = list;
APR_RING_INIT(&b->list, apr_bucket, link);
- if (p) {
- apr_pool_cleanup_register(b->p, b, brigade_cleanup,
- apr_pool_cleanup_null);
- }
+ apr_pool_cleanup_register(b->p, b, brigade_cleanup,
apr_pool_cleanup_null);
return b;
}