apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <jwool...@virginia.edu>
Subject Re: update for bucket api patch
Date Sat, 02 Mar 2002 23:22:23 GMT
On Sat, 2 Mar 2002, Brian Pane wrote:

> I had to add an allocator as an argument to
> SPLIT_AND_PASS_PRETAG_BUCKETS to get mod_include
> and mod_cgi to work (a patch against current CVS head
> is attached)

Whoops, that must have gotten lost in the big cvs-conflict-resolution run.
Don't know how I managed to get it to compile... <sigh>.  Anyway, what I
would have done it this way:


Index: mod_include.h
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.h,v
retrieving revision 1.29
diff -u -d -r1.29 mod_include.h
--- mod_include.h       23 Feb 2002 20:56:36 -0000      1.29
+++ mod_include.h       2 Mar 2002 23:20:55 -0000
@@ -208,7 +209,8 @@
                                                                   \
     tag_plus = apr_brigade_split(brgd, cntxt->head_start_bucket); \
     if (cntxt->output_flush) {                                    \
-        APR_BRIGADE_INSERT_TAIL(brgd, apr_bucket_flush_create()); \
+        APR_BRIGADE_INSERT_TAIL(brgd,                             \
+            apr_bucket_flush_create(brgd->bucket_alloc));         \
     }                                                             \
     rc = ap_pass_brigade(next, brgd);                             \
     cntxt->bytes_parsed = 0;                                      \


The whole reason for having a bucket_alloc stored with the brigade itself
is so that you can get at it when you are creating buckets that you know
you're just going to stick immediately into that brigade and be done with
them.  This is the trick I needed to avoid redoing the entire
apr_brigade_printf() and friends API, which would have been a massive
undertaking (I know because I tried it once).

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message