You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Brian Pane <bp...@pacbell.net> on 2002/03/03 00:11:57 UTC

update for bucket api patch

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)

--Brian



Re: update for bucket api patch

Posted by Brian Pane <bp...@pacbell.net>.
Cliff Woolley wrote:

>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;                                      \
>

Makes sense; I like this approach a lot better than my patch to add an 
extra arg
--Brian



Re: update for bucket api patch

Posted by Cliff Woolley <jw...@virginia.edu>.
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