geoff 2004/01/28 05:54:36
Modified: t/apr .cvsignore xs/APR/Brigade APR__Brigade.h xs/maps apr_functions.map apr_structures.map xs/tables/current/Apache StructureTable.pm xs/tables/current/ModPerl FunctionTable.pm Added: t/response/TestAPR brigade.pm Log: add APR::Brigade::pool() to allow access to the pool associated with the brigade Revision Changes Path 1.10 +1 -0 modperl-2.0/t/apr/.cvsignore Index: .cvsignore =================================================================== RCS file: /home/cvs/modperl-2.0/t/apr/.cvsignore,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- .cvsignore 23 Jan 2004 19:34:43 -0000 1.9 +++ .cvsignore 28 Jan 2004 13:54:20 -0000 1.10 @@ -14,3 +14,4 @@ threadmutex.t finfo.t flatten.t +brigade.t 1.1 modperl-2.0/t/response/TestAPR/brigade.pm Index: brigade.pm =================================================================== package TestAPR::brigade; use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use Apache::RequestRec (); use APR::Brigade (); use Apache::Const -compile => 'OK'; sub handler { my $r = shift; plan $r, tests => 4; # simple constructor and accessor tests my $bb = APR::Brigade->new($r->pool, $r->connection->bucket_alloc); t_debug('$bb is defined'); ok defined $bb; t_debug('$bb ISA APR::Brigade object'); ok $bb->isa('APR::Brigade'); my $pool = $bb->pool; t_debug('$pool is defined'); ok defined $pool; t_debug('$pool ISA APR::Pool object'); ok $pool->isa('APR::Pool'); Apache::OK; } 1; 1.7 +10 -0 modperl-2.0/xs/APR/Brigade/APR__Brigade.h Index: APR__Brigade.h =================================================================== RCS file: /home/cvs/modperl-2.0/xs/APR/Brigade/APR__Brigade.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- APR__Brigade.h 27 Jan 2004 16:34:36 -0000 1.6 +++ APR__Brigade.h 28 Jan 2004 13:54:27 -0000 1.7 @@ -68,6 +68,16 @@ } static MP_INLINE +apr_pool_t *mpxs_APR__Brigade_pool(apr_bucket_brigade *brigade) +{ + /* eesh, it's r->pool, and c->pool, but bb->p + * let's make Perl consistent, otherwise this could be autogenerated + */ + + return brigade->p; +} + +static MP_INLINE SV *mpxs_APR__Brigade_length(pTHX_ apr_bucket_brigade *bb, int read_all) { 1.68 +1 -0 modperl-2.0/xs/maps/apr_functions.map Index: apr_functions.map =================================================================== RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- apr_functions.map 27 Jan 2004 16:34:36 -0000 1.67 +++ apr_functions.map 28 Jan 2004 13:54:35 -0000 1.68 @@ -99,6 +99,7 @@ mpxs_APR__Brigade_empty #APR_BRIGADE_EMPTY mpxs_APR__Brigade_length | | bb, read_all=1 mpxs_APR__Brigade_flatten | | bb, pool, sv_len=0 + mpxs_APR__Brigade_pool MODULE=APR::Bucket mpxs_APR__Bucket_is_flush #APR_BUCKET_IS_FLUSH 1.11 +6 -0 modperl-2.0/xs/maps/apr_structures.map Index: apr_structures.map =================================================================== RCS file: /home/cvs/modperl-2.0/xs/maps/apr_structures.map,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- apr_structures.map 17 Dec 2003 19:46:15 -0000 1.10 +++ apr_structures.map 28 Jan 2004 13:54:35 -0000 1.11 @@ -28,6 +28,12 @@ > list </apr_bucket> +<apr_bucket_brigade> +~ pool +> list +> bucket_alloc +</apr_bucket_brigade> + <apr_finfo_t> pool valid 1.37 +17 -0 modperl-2.0/xs/tables/current/Apache/StructureTable.pm Index: StructureTable.pm =================================================================== RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/StructureTable.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- StructureTable.pm 30 May 2003 12:55:14 -0000 1.36 +++ StructureTable.pm 28 Jan 2004 13:54:36 -0000 1.37 @@ -1194,6 +1194,23 @@ ] }, { + 'type' => 'apr_bucket_brigade', + 'elts' => [ + { + 'type' => 'apr_pool_t *', + 'name' => 'p' + }, + { + 'type' => '_ANON 68', + 'name' => 'link' + }, + { + 'type' => 'apr_bucket_alloc_t *', + 'name' => 'bucket_alloc' + } + ] + }, + { 'type' => 'apr_bucket_alloc_t', 'elts' => [] }, 1.141 +10 -0 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm =================================================================== RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v retrieving revision 1.140 retrieving revision 1.141 diff -u -r1.140 -r1.141 --- FunctionTable.pm 27 Jan 2004 16:34:36 -0000 1.140 +++ FunctionTable.pm 28 Jan 2004 13:54:36 -0000 1.141 @@ -6444,6 +6444,16 @@ ] }, { + 'return_type' => 'apr_pool_t *', + 'name' => 'mpxs_APR__Brigade_pool', + 'args' => [ + { + 'type' => 'apr_bucket_brigade *', + 'name' => 'brigade' + }, + ] + }, + { 'return_type' => 'SV *', 'name' => 'mpxs_APR__Brigade_length', 'args' => [