cvs commit: modperl-2.0/lib/ModPerl Config.pm
dougm 01/04/24 20:14:44 Modified:lib/ModPerl Config.pm Log: want httpd -V not -v Revision ChangesPath 1.3 +1 -1 modperl-2.0/lib/ModPerl/Config.pm Index: Config.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Config.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Config.pm 2001/04/20 18:25:45 1.2 +++ Config.pm 2001/04/25 03:14:44 1.3 @@ -20,7 +20,7 @@ my $test_config = Apache::TestConfig-new; my $httpd = $test_config-{vars}-{httpd}; -my $command = $httpd -v; +my $command = $httpd -V; $cfg .= \n\n*** $command\n; $cfg .= qx{$command};
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigParse.pm
dougm 01/04/24 21:35:21 Modified:Apache-Test/lib/Apache TestConfigParse.pm Log: save some more info from httpd -V Revision ChangesPath 1.3 +10 -4 modperl-2.0/Apache-Test/lib/Apache/TestConfigParse.pm Index: TestConfigParse.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigParse.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestConfigParse.pm2001/04/13 00:28:46 1.2 +++ TestConfigParse.pm2001/04/25 04:35:20 1.3 @@ -192,11 +192,17 @@ open my $proc, '-|', $cmd or die $cmd failed: $!; while ($proc) { -next unless s/^\s*-D\s*//; -s/\s+$//; chomp; -my($key, $val) = split '=', $_, 2; -$self-{httpd_defines}-{$key} = $val ? strip_quotes($val) : 1; +if( s/^\s*-D\s*//) { +s/\s+$//; +my($key, $val) = split '=', $_, 2; +$self-{httpd_defines}-{$key} = $val ? strip_quotes($val) : 1; +} +elsif (/(version|built|module magic number):\s+(.*)/i) { +my $val = $2; +(my $key = uc $1) =~ s/\s/_/g; +$self-{httpd_info}-{$key} = $val; +} } close $proc;
cvs commit: modperl-2.0/src/modules/perl modperl_interp.c modperl_util.c modperl_util.h
dougm 01/04/24 22:27:17 Modified:src/modules/perl modperl_interp.c modperl_util.c modperl_util.h Log: use apr_os_dso_handle_put/apr_dso_unload rather than the unportable dlclose() Revision ChangesPath 1.32 +1 -1 modperl-2.0/src/modules/perl/modperl_interp.c Index: modperl_interp.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- modperl_interp.c 2001/04/09 23:57:22 1.31 +++ modperl_interp.c 2001/04/25 05:27:17 1.32 @@ -98,7 +98,7 @@ perl_free(interp-perl); if (handles) { -modperl_xs_dl_handles_close(handles); +modperl_xs_dl_handles_close(p, handles); } apr_pool_destroy(p); 1.9 +8 -5 modperl-2.0/src/modules/perl/modperl_util.c Index: modperl_util.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- modperl_util.c2001/04/25 03:13:59 1.8 +++ modperl_util.c2001/04/25 05:27:17 1.9 @@ -162,7 +162,7 @@ return handles; } -void modperl_xs_dl_handles_close(apr_array_header_t *handles) +void modperl_xs_dl_handles_close(apr_pool_t *p, apr_array_header_t *handles) { int i; @@ -171,10 +171,13 @@ } for (i=0; i handles-nelts; i++) { - void *handle = ((void **)handles-elts)[i]; - MP_TRACE_g(MP_FUNC, close 0x%lx\n, - (unsigned long)handle); - dlclose(handle); /*XXX*/ +apr_dso_handle_t *dso = NULL; +void *handle = ((void **)handles-elts)[i]; + +MP_TRACE_g(MP_FUNC, close 0x%lx\n, (unsigned long)handle); + +apr_os_dso_handle_put(dso, (apr_os_dso_handle_t )handle, p); +apr_dso_unload(dso); } } 1.10 +1 -1 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- modperl_util.h2001/04/25 03:13:59 1.9 +++ modperl_util.h2001/04/25 05:27:17 1.10 @@ -35,7 +35,7 @@ apr_array_header_t *modperl_xs_dl_handles_get(pTHX_ apr_pool_t *p); -void modperl_xs_dl_handles_close(apr_array_header_t *handles); +void modperl_xs_dl_handles_close(apr_pool_t *p, apr_array_header_t *handles); modperl_cleanup_data_t *modperl_cleanup_data_new(apr_pool_t *p, void *data);
cvs commit: modperl-2.0/pod modperl_dev.pod
dougm 01/04/24 22:38:41 Modified:pod modperl_dev.pod Log: fixo Revision ChangesPath 1.20 +2 -2 modperl-2.0/pod/modperl_dev.pod Index: modperl_dev.pod === RCS file: /home/cvs/modperl-2.0/pod/modperl_dev.pod,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- modperl_dev.pod 2001/04/25 05:26:27 1.19 +++ modperl_dev.pod 2001/04/25 05:38:41 1.20 @@ -26,8 +26,8 @@ version and rebuild, run: % cd httpd-2.0 - % cvs up - % make testclean ./buildconf + % cvs up -dP + % make distclean ./buildconf % ./configure --prefix=$HOME/apache-2.0 \ --with-mpm=threaded --enable-so % make make install
cvs commit: modperl-2.0/pod modperl_dev.pod
dougm 01/04/24 23:10:07 Modified:pod modperl_dev.pod Log: Perl does not use cvs Revision ChangesPath 1.22 +1 -1 modperl-2.0/pod/modperl_dev.pod Index: modperl_dev.pod === RCS file: /home/cvs/modperl-2.0/pod/modperl_dev.pod,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- modperl_dev.pod 2001/04/25 05:54:54 1.21 +++ modperl_dev.pod 2001/04/25 06:10:05 1.22 @@ -41,7 +41,7 @@ % make make test make install % ln -s $HOME/bleedperl/bin/perl5.x.x $HOME/bleedperl/bin/perl -If you are re-building Perl after cvs update, make sure to cleanup: +If you are re-building Perl after rsync-ing, make sure to cleanup: % make distclean
cvs commit: modperl-2.0/xs/maps apache_functions.map
dougm 01/04/23 19:26:19 Modified:src/modules/perl modperl_filter.c modperl_filter.h t/filter/TestFilter input_body.pm input_msg.pm xs/Apache/Filter Apache__Filter.h xs/maps apache_functions.map Log: adjust to ap_get_brigade() / input filter api changes Revision ChangesPath 1.17 +7 -4 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- modperl_filter.c 2001/04/20 00:43:47 1.16 +++ modperl_filter.c 2001/04/24 02:26:17 1.17 @@ -86,7 +86,8 @@ return mg ? (modperl_filter_t *)mg-mg_ptr : NULL; } -int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode) +int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode, + apr_size_t *readbytes) { AV *args = Nullav; int status; @@ -109,6 +110,7 @@ if (filter-mode == MP_INPUT_FILTER_MODE) { av_push(args, newSViv(mode)); +av_push(args, newSViv(*readbytes)); } if ((status = modperl_callback(aTHX_ handler, p, s, args)) != OK) { @@ -321,7 +323,7 @@ } else { filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE); -status = modperl_run_filter(filter, 0); +status = modperl_run_filter(filter, 0, 0); } switch (status) { @@ -336,7 +338,8 @@ apr_status_t modperl_input_filter_handler(ap_filter_t *f, apr_bucket_brigade *bb, - ap_input_mode_t mode) + ap_input_mode_t mode, + apr_size_t *readbytes) { modperl_filter_t *filter; int status; @@ -348,7 +351,7 @@ } else { filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE); -status = modperl_run_filter(filter, mode); +status = modperl_run_filter(filter, mode, readbytes); } switch (status) { 1.6 +4 -2 modperl-2.0/src/modules/perl/modperl_filter.h Index: modperl_filter.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- modperl_filter.h 2001/04/20 00:43:47 1.5 +++ modperl_filter.h 2001/04/24 02:26:17 1.6 @@ -25,7 +25,8 @@ modperl_filter_t *modperl_filter_mg_get(pTHX_ SV *obj); -int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode); +int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode, + apr_size_t *readbytes); /* output filters */ apr_status_t modperl_output_filter_handler(ap_filter_t *f, @@ -49,7 +50,8 @@ /* input filters */ apr_status_t modperl_input_filter_handler(ap_filter_t *f, apr_bucket_brigade *bb, - ap_input_mode_t mode); + ap_input_mode_t mode, + apr_size_t *readbytes); int modperl_input_filter_register_connection(conn_rec *c); 1.4 +2 -2 modperl-2.0/t/filter/TestFilter/input_body.pm Index: input_body.pm === RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_body.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- input_body.pm 2001/04/20 01:21:28 1.3 +++ input_body.pm 2001/04/24 02:26:17 1.4 @@ -13,10 +13,10 @@ use APR::Bucket (); sub handler : InputFilterBody { -my($filter, $bb, $mode) = @_; +my($filter, $bb, $mode, $readbytes) = @_; if ($bb-empty) { -my $rv = $filter-next-get_brigade($bb, $mode); +my $rv = $filter-next-get_brigade($bb, $mode, $readbytes); if ($rv != APR::SUCCESS) { return $rv; 1.4 +2 -2 modperl-2.0/t/filter/TestFilter/input_msg.pm Index: input_msg.pm === RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_msg.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- input_msg.pm 2001/04/20 01:21:28 1.3 +++ input_msg.pm 2001/04/24 02:26:17 1.4 @@ -14,10 +14,10 @@ my $to_url = '/TestFilter::input_msg::response'; sub handler : InputFilterMessage { -my($filter, $bb, $mode) = @_; +my($filter, $bb, $mode, $readbytes
cvs commit: modperl-2.0/src/modules/perl modperl_types.h
dougm 01/04/23 22:10:41 Modified:src/modules/perl modperl_types.h Log: allow MP_IOBUFSIZE to be -D defined Revision ChangesPath 1.37 +6 -4 modperl-2.0/src/modules/perl/modperl_types.h Index: modperl_types.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- modperl_types.h 2001/04/19 21:26:35 1.36 +++ modperl_types.h 2001/04/24 05:10:40 1.37 @@ -1,10 +1,12 @@ #ifndef MODPERL_TYPES_H #define MODPERL_TYPES_H -#ifdef AP_IOBUFSIZE -# define MP_IOBUFSIZE AP_IOBUFSIZE -#else -# define MP_IOBUFSIZE 8192 +#ifndef MP_IOBUFSIZE +# ifdef AP_IOBUFSIZE +# define MP_IOBUFSIZE AP_IOBUFSIZE +# else +# define MP_IOBUFSIZE 8192 +# endif #endif /* aliases */
cvs commit: modperl-2.0/util config.pl
dougm 01/04/20 10:07:49 Added: util config.pl Log: add util/config.pl script to report configuration Revision ChangesPath 1.1 modperl-2.0/util/config.pl Index: config.pl === use lib qw(lib); use lib qw(Apache-Test/lib); use Apache::Build (); use Apache::TestConfig (); my $build_config = Apache::Build-build_config; print "using $INC{'Apache/BuildConfig.pm'}\n"; print "Makefile.PL options:\n"; for (sort keys %$build_config) { next unless /^MP_/; printf "%-20s = %s\n", $_, $build_config-{$_}; } my $test_config = Apache::TestConfig-new; my $httpd = $test_config-{vars}-{httpd}; print "\n$httpd -V:\n"; system "$httpd -V"; my $perl = $build_config-{MODPERL_PERLPATH}; print "\n$perl -V:\n"; system "$perl -V";
cvs commit: modperl-2.0/lib/Apache Build.pm
dougm 01/04/20 10:09:20 Modified:lib/Apache Build.pm Log: prevent warning Revision ChangesPath 1.42 +1 -0 modperl-2.0/lib/Apache/Build.pm Index: Build.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- Build.pm 2001/04/10 22:52:36 1.41 +++ Build.pm 2001/04/20 17:09:16 1.42 @@ -440,6 +440,7 @@ $self-default_dir, '../httpd-2.0') { + next unless $src_dir; next unless (-d $src_dir || -l $src_dir); next if $seen{$src_dir}++; push @dirs, $src_dir;
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm
dougm 01/04/20 09:46:52 Modified:Apache-Test/lib/Apache TestConfig.pm Log: deal properly with args Revision ChangesPath 1.10 +5 -2 modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm Index: TestConfig.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- TestConfig.pm 2001/04/19 21:21:16 1.9 +++ TestConfig.pm 2001/04/20 16:46:50 1.10 @@ -74,9 +74,12 @@ } sub new { -my($class, $args) = @_; +my $class = shift; +my $args; -$args = ($args and ref($args)) ? {%$args} : {@_}; #copy +$args = shift if $_[0] and ref $_[0]; + +$args = $args ? {%$args} : {@_}; #copy my $thaw = {};
cvs commit: modperl-2.0/util config.pl
dougm 01/04/20 09:50:57 Modified:pod modperl_dev.pod Added: util config.pl Log: add util/config.pl script to report configuration Revision ChangesPath No revision No revision
cvs commit: modperl-2.0 Makefile.PL
dougm 01/04/20 10:43:04 Modified:.Makefile.PL Log: need to push tables_dir into @INC when xs is not generated Revision ChangesPath 1.34 +11 -5 modperl-2.0/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- Makefile.PL 2001/04/12 16:03:55 1.33 +++ Makefile.PL 2001/04/20 17:42:57 1.34 @@ -73,7 +73,14 @@ generate_script($_); } -generate_xs($httpd_version) if $build-{MP_GENERATE_XS}; +my $tables_dir = tables_dir($httpd_version); + +unshift @INC, $tables_dir; + +if ($build-{MP_GENERATE_XS}) { +print "generating XS code using $tables_dir...\n"; +generate_xs($httpd_version); +} } sub post_configure { @@ -97,7 +104,7 @@ $build-save; } -sub generate_xs { +sub tables_dir { my $httpd_version = shift; my $tables_version = 'current'; @@ -105,10 +112,9 @@ #$httpd_version =~ /-dev$/ ? 'current' : $httpd_version; my $tables_dir = "xs/tables/$tables_version"; -unshift @INC, $tables_dir; - -print "generating XS code using $tables_dir...\n"; +} +sub generate_xs { require ModPerl::WrapXS; my $xs = ModPerl::WrapXS-new;
cvs commit: modperl-2.0/lib/ModPerl WrapXS.pm
dougm 01/04/20 11:03:49 Modified:lib/ModPerl WrapXS.pm Log: use thr corrent lib path Revision ChangesPath 1.8 +1 -1 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- WrapXS.pm 2001/04/20 03:07:53 1.7 +++ WrapXS.pm 2001/04/20 18:03:45 1.8 @@ -283,7 +283,7 @@ print $fh EOF; $self-{noedit_warning_hash} -use lib qw(../../lib); #for Apache::BuildConfig +use lib qw(../../../lib); #for Apache::BuildConfig use ModPerl::MM (); ModPerl::MM::WriteMakefile(
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm
dougm 01/04/19 10:21:35 Modified:Apache-Test/lib/Apache TestConfigPerl.pm Log: hack for testing PerlInputFilterHandlers Revision ChangesPath 1.8 +8 -1 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm Index: TestConfigPerl.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TestConfigPerl.pm 2001/04/13 02:04:52 1.7 +++ TestConfigPerl.pm 2001/04/19 17:21:32 1.8 @@ -229,7 +229,8 @@ return unless /\.pm$/; my @args; -my $module = catfile $File::Find::dir, $_; +my $pm = $_; +my $module = catfile $File::Find::dir, $pm; $self-add_module_config($module, \@args); $module = abs2rel $module, $dir; $module =~ s,\.pm$,,; @@ -239,6 +240,12 @@ map { s/^test//i; $_ } split '::', $module; my $hook = $hooks{$sub} || $hooks{$subdir} || $subdir; + +if ($hook eq 'OutputFilter' and $pm =~ /^i/) { +#XXX: tmp hack +$hook = 'InputFilter'; +} + my $handler = join $hook, qw(Perl Handler); if ($self-server-{rev} 2 and lc($hook) eq 'response') {
cvs commit: modperl-2.0/lib/Apache ParseSource.pm
dougm 01/04/19 10:22:57 Modified:lib/Apache ParseSource.pm Log: generate tables into the xs/tables/current directory, pickup apr_read_type enum Revision ChangesPath 1.16 +4 -3 modperl-2.0/lib/Apache/ParseSource.pm Index: ParseSource.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ParseSource.pm2001/04/18 05:27:39 1.15 +++ ParseSource.pm2001/04/19 17:22:54 1.16 @@ -165,7 +165,7 @@ my %enums_wanted = ( Apache = { map { $_, 1 } qw(cmd_how input_mode filter_type) }, -APR = { map { $_, 1 } qw(apr_shutdown_how) }, +APR = { map { $_, 1 } qw(apr_shutdown_how apr_read_type) }, ); my $defines_unwanted = join '|', qw{ @@ -390,8 +390,9 @@ my($subdir) = (split '::', $name)[0]; -if (-d "lib/$subdir") { -$file = "lib/$subdir/$file"; +my $tdir = 'xs/tables/current'; +if (-d "$tdir/$subdir") { +$file = "$tdir/$subdir/$file"; } open my $pm, '', $file or die "open $file: $!";
cvs commit: modperl-2.0/lib/ModPerl ParseSource.pm
dougm 01/04/19 10:23:27 Modified:lib/ModPerl ParseSource.pm Log: re fixup Revision ChangesPath 1.2 +2 -2 modperl-2.0/lib/ModPerl/ParseSource.pm Index: ParseSource.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/ParseSource.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ParseSource.pm2001/03/04 23:26:53 1.1 +++ ParseSource.pm2001/04/19 17:23:23 1.2 @@ -29,8 +29,8 @@ \@wanted; } -my $prefixes = join '|', qw(modperl_|mpxs_|mp_xs); -my $prefix_re = qr{^($prefixes)}; +my $prefixes = join '|', qw(modperl mpxs mp_xs); +my $prefix_re = qr{^($prefixes)_}; sub wanted_functions { $prefix_re } sub write_functions_pm {
cvs commit: modperl-2.0/lib/ModPerl WrapXS.pm
dougm 01/04/19 10:24:46 Modified:lib/ModPerl WrapXS.pm Log: ablity to add code to the generate .pm Revision ChangesPath 1.6 +29 -2 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WrapXS.pm 2001/04/06 21:31:58 1.5 +++ WrapXS.pm 2001/04/19 17:24:43 1.6 @@ -57,8 +57,9 @@ my $typemap = $self-typemap; for my $entry (@{ $self-function_list() }) { -my $func; -next unless $func = $typemap-map_function($entry); +my $func = $typemap-map_function($entry); +#print "FAILED to map $entry-{name}\n" unless $func; +next unless $func; my($name, $module, $class, $args) = @{ $func } { qw(perl_name module class args) }; @@ -311,6 +312,22 @@ undef; } +sub mod_pm { +my($self, $module, $complete) = @_; + +my $dirname = $self-class_dirname($module); +my($base, $sub) = split '::', $module; +my $mod_pm = "$dirname/${sub}_pm"; + +for ($self-{XS_DIR}, @{ $self-{glue_dirs} }) { +my $file = "$_/$mod_pm"; +$mod_pm = $file if $complete; +return $mod_pm if -e $file; +} + +undef; +} + sub class_c_prefix { my $class = shift; $class =~ s/:/_/g; @@ -417,6 +434,14 @@ my $isa = $self-isa_str($module); +my $code = ""; +if (my $mod_pm = $self-mod_pm($module, 1)) { +open my $fh, '', $mod_pm; +local $/; +$code = $fh; +close $fh; +} + my $fh = $self-open_class_file($module, '.pm'); print $fh EOF; $self-{noedit_warning_hash} @@ -425,6 +450,8 @@ $isa use XSLoader (); XSLoader::load __PACKAGE__; + +$code 1; __END__
cvs commit: modperl-2.0/t/filter/TestFilter buckets.pm
dougm 01/04/19 10:31:10 Modified:t/filter/TestFilter buckets.pm Log: adjust APR::Bucket-readapi change Revision ChangesPath 1.2 +2 -1 modperl-2.0/t/filter/TestFilter/buckets.pm Index: buckets.pm === RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/buckets.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- buckets.pm2001/04/18 05:11:14 1.1 +++ buckets.pm2001/04/19 17:31:06 1.2 @@ -20,7 +20,8 @@ for (my $bucket = $bb-first; $bucket; $bucket = $bb-next($bucket)) { ok $bucket-type-name; ok $bucket-length == 2; -ok $bucket-read eq 'ok'; +$bucket-read(my $data); +ok $data eq 'ok'; } my $tests = Apache::TestToString-finish;
cvs commit: modperl-2.0/t/response/TestApache post.pm
dougm 01/04/19 10:36:37 Modified:t/response/TestApache post.pm Log: move read_post util so it can be used by other tests Revision ChangesPath 1.2 +1 -18 modperl-2.0/t/response/TestApache/post.pm Index: post.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/post.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- post.pm 2001/04/02 09:06:07 1.1 +++ post.pm 2001/04/19 17:36:34 1.2 @@ -3,28 +3,11 @@ use strict; use warnings FATAL = 'all'; -use APR::Table (); - -sub read_post { -my $r = shift; - -$r-setup_client_block; - -return undef unless $r-should_client_block; - -my $len = $r-headers_in-get('content-length'); - -my $buf; -$r-get_client_block($buf, $len); - -return $buf; -} - sub handler { my $r = shift; $r-content_type('text/plain'); -my $data = read_post($r) || ""; +my $data = ModPerl::Test::read_post($r) || ""; $r-puts(join ':', length($data), $data);
cvs commit: modperl-2.0/xs modperl_xs_util.h
dougm 01/04/19 10:37:05 Modified:xs modperl_xs_util.h Log: add a few handy macros Revision ChangesPath 1.5 +5 -0 modperl-2.0/xs/modperl_xs_util.h Index: modperl_xs_util.h === RCS file: /home/cvs/modperl-2.0/xs/modperl_xs_util.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- modperl_xs_util.h 2001/04/02 19:30:31 1.4 +++ modperl_xs_util.h 2001/04/19 17:37:02 1.5 @@ -1,6 +1,8 @@ #ifndef MODPERL_XS_H #define MODPERL_XS_H +#define MP_CODE_ATTRS(cv) (CvXSUBANY((CV*)cv).any_i32) + #ifndef dAX #define dAXI32 ax = mark - PL_stack_base + 1 #endif @@ -17,6 +19,9 @@ #define PUSHs_mortal_iv(iv) PUSHs(sv_2mortal(newSViv(iv))) #define PUSHs_mortal_pv(pv) PUSHs(sv_2mortal(newSVpv((char *)pv,0))) + +#define XPUSHs_mortal_iv(iv) EXTEND(SP, 1); PUSHs_mortal_iv(iv) +#define XPUSHs_mortal_pv(pv) EXTEND(SP, 1); PUSHs_mortal_pv(pv) #define mpxs_sv_grow(sv, len) \ (void)SvUPGRADE(sv, SVt_PV); \
cvs commit: modperl-2.0/xs/APR/Bucket APR__Bucket.h
dougm 01/04/19 10:38:16 Modified:xs/APR/Bucket APR__Bucket.h Log: proper implementation of APR::Bucket-read Revision ChangesPath 1.2 +20 -11modperl-2.0/xs/APR/Bucket/APR__Bucket.h Index: APR__Bucket.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- APR__Bucket.h 2001/04/18 04:43:44 1.1 +++ APR__Bucket.h 2001/04/19 17:38:12 1.2 @@ -12,24 +12,33 @@ return modperl_bucket_sv_create(aTHX_ sv, offset, len); } -static MP_INLINE const char *mpxs_APR__Bucket_read(apr_bucket *bucket, - apr_ssize_t wanted) +/* this is just so C::Scan will pickup the prototype */ +static MP_INLINE apr_status_t modperl_bucket_read(apr_bucket *bucket, + const char **str, + apr_size_t *len, + apr_read_type_e block) { +return apr_bucket_read(bucket, str, len, block); +} + +static MP_INLINE apr_status_t mpxs_modperl_bucket_read(pTHX_ + apr_bucket *bucket, + SV *buffer, + apr_read_type_e block) +{ int rc; apr_ssize_t len; const char *str; -rc = apr_bucket_read(bucket, str, len, wanted); +rc = modperl_bucket_read(bucket, str, len, block); -if ((rc != APR_SUCCESS) || !str) { -if (rc != APR_EOF) { -/* XXX: croak */ -} -return NULL; -} -else { -return str; +if ((rc != APR_SUCCESS) (rc != APR_EOF)) { +/* XXX: croak ? */ } + +sv_setpvn(buffer, str, len); + +return rc; } static MP_INLINE int mpxs_APR__Bucket_is_eos(apr_bucket *bucket)
cvs commit: modperl-2.0/xs/Apache/Filter Apache__Filter.h
dougm 01/04/19 10:38:56 Modified:xs/Apache/Filter Apache__Filter.h Log: add MODIFY_CODE_ATTRIBUTES method Revision ChangesPath 1.4 +42 -0 modperl-2.0/xs/Apache/Filter/Apache__Filter.h Index: Apache__Filter.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Apache__Filter.h 2001/04/13 07:17:07 1.3 +++ Apache__Filter.h 2001/04/19 17:38:54 1.4 @@ -55,3 +55,45 @@ return len; } + +static MP_INLINE I32 *modperl_filter_attributes(SV *package, SV *cvrv) +{ +return MP_CODE_ATTRS(SvRV(cvrv)); +} + +static XS(MPXS_modperl_filter_attributes) +{ +dXSARGS; +I32 *attrs = modperl_filter_attributes(ST(0), ST(1)); +I32 i; + +for (i=2; i items; i++) { +STRLEN len; +char *pv = SvPV(ST(i), len); +char *attribute = pv; + +switch (*pv) { + case 'I': +if (strnEQ(pv, "InputFilter", 11)) { +pv += 11; +switch (*pv) { + case 'B': +if (strEQ(pv, "Body")) { +*attrs |= MP_INPUT_FILTER_BODY; +continue; +} + case 'M': +if (strEQ(pv, "Message")) { +*attrs |= MP_INPUT_FILTER_MESSAGE; +continue; +} +} +} + default: +XPUSHs_mortal_pv(attribute); +XSRETURN(1); +} +} + +XSRETURN_EMPTY; +}
cvs commit: modperl-2.0/src/modules/perl mod_perl.c modperl_filter.c modperl_filter.h
dougm 01/04/19 10:44:22 Modified:src/modules/perl mod_perl.c modperl_filter.c modperl_filter.h Log: register/run PerlInputFilterHandlers Revision ChangesPath 1.48 +30 -2 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- mod_perl.c2001/04/12 16:15:19 1.47 +++ mod_perl.c2001/04/19 17:44:15 1.48 @@ -221,6 +221,11 @@ */ } +static int modperl_hook_pre_connection(conn_rec *c) +{ +return modperl_input_filter_register_connection(c); +} + static void modperl_hook_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { @@ -246,10 +251,23 @@ return OK; } +static int modperl_hook_post_read_request(request_rec *r) +{ +return modperl_input_filter_register_request(r); +} + +static int modperl_hook_header_parser(request_rec *r) +{ +return modperl_input_filter_register_request(r); +} + void modperl_register_hooks(apr_pool_t *p) { ap_hook_open_logs(modperl_hook_init, NULL, NULL, APR_HOOK_MIDDLE); +ap_hook_post_config(modperl_hook_post_config, NULL, NULL, +APR_HOOK_MIDDLE); + ap_hook_handler(modperl_response_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_insert_filter(modperl_output_filter_register, @@ -259,11 +277,21 @@ modperl_output_filter_handler, AP_FTYPE_CONTENT); +ap_register_input_filter(MODPERL_INPUT_FILTER_NAME, + modperl_input_filter_handler, + AP_FTYPE_CONTENT); + +ap_hook_pre_connection(modperl_hook_pre_connection, + NULL, NULL, APR_HOOK_FIRST); + ap_hook_create_request(modperl_hook_create_request, NULL, NULL, APR_HOOK_MIDDLE); -ap_hook_post_config(modperl_hook_post_config, NULL, NULL, -APR_HOOK_MIDDLE); +ap_hook_post_read_request(modperl_hook_post_read_request, NULL, NULL, + APR_HOOK_FIRST); + +ap_hook_header_parser(modperl_hook_header_parser, NULL, NULL, + APR_HOOK_FIRST); modperl_register_handler_hooks(); } 1.12 +121 -3modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- modperl_filter.c 2001/04/18 04:37:46 1.11 +++ modperl_filter.c 2001/04/19 17:44:17 1.12 @@ -79,7 +79,7 @@ return filter; } -int modperl_run_filter(modperl_filter_t *filter) +int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode) { AV *args = Nullav; int status; @@ -88,7 +88,7 @@ request_rec *r = filter-f-r; conn_rec*c = filter-f-c; -server_rec *s = r ? r-server : NULL; +server_rec *s = r ? r-server : c-base_server; apr_pool_t *p = r ? r-pool : c-pool; MP_dINTERP_SELECT(r, c, s); @@ -98,6 +98,10 @@ "APR::Brigade", filter-bb, NULL); +if (filter-mode == MP_INPUT_FILTER_MODE) { +av_push(args, newSViv(mode)); +} + if ((status = modperl_callback(aTHX_ handler, p, s, args)) != OK) { status = modperl_errsv(aTHX_ status, r, s); } @@ -319,7 +323,7 @@ } else { filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE); -status = modperl_run_filter(filter); +status = modperl_run_filter(filter, 0); } switch (status) { @@ -332,6 +336,32 @@ } } +apr_status_t modperl_input_filter_handler(ap_filter_t *f, + apr_bucket_brigade *bb, + ap_input_mode_t mode) +{ +modperl_filter_t *filter; +int status; + +if (APR_BRIGADE_IS_EOS(bb)) { +/* XXX: see about preventing this in the first place */ +MP_TRACE_f(MP_FUNC, "first bucket is EOS, skipping callback\n"); +return APR_SUCCESS; +} +else { +filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE); +status = modperl_run_filter(filter, mode); +} + +switch (status) { + case OK: + case DECLINED: +return APR_SUCCESS; + default: +
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 01/04/19 10:45:31 Modified:xs/tables/current/Apache ConstantsTable.pm FunctionTable.pm StructureTable.pm xs/tables/current/ModPerl FunctionTable.pm Log: sync Revision ChangesPath 1.6 +5 -1 modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm Index: ConstantsTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ConstantsTable.pm 2001/04/18 05:28:18 1.5 +++ ConstantsTable.pm 2001/04/19 17:45:21 1.6 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Tue Apr 17 22:15:55 2001 +# ! Thu Apr 19 10:01:37 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -148,6 +148,10 @@ ] }, 'APR' = { +'read_type' = [ + 'APR_BLOCK_READ', + 'APR_NONBLOCK_READ' +], 'fileperms' = [ 'APR_UREAD', 'APR_UWRITE', 1.3 +125 -93 modperl-2.0/xs/tables/current/Apache/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FunctionTable.pm 2001/04/18 04:42:50 1.2 +++ FunctionTable.pm 2001/04/19 17:45:22 1.3 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Tue Apr 17 21:37:29 2001 +# ! Thu Apr 19 10:01:42 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -3488,6 +3488,38 @@ 'return_type' = 'apr_status_t', 'args' = [ { +'name' = 'dso', +'type' = 'apr_dso_handle_t **' + }, + { +'name' = 'thedso', +'type' = 'apr_os_dso_handle_t *' + }, + { +'name' = 'pool', +'type' = 'apr_pool_t *' + } +], +'name' = 'apr_os_dso_handle_put' + }, + { +'return_type' = 'apr_status_t', +'args' = [ + { +'name' = 'dso', +'type' = 'apr_os_dso_handle_t *' + }, + { +'name' = 'aprdso', +'type' = 'apr_dso_handle_t *' + } +], +'name' = 'apr_os_dso_handle_get' + }, + { +'return_type' = 'apr_status_t', +'args' = [ + { 'name' = 'm', 'type' = 'apr_shmem_t **' }, @@ -9506,98 +9538,6 @@ 'name' = 'ap_matches_request_vhost' }, { -'return_type' = 'int', -'args' = [], -'name' = 'ap_exists_scoreboard_image' - }, - { -'return_type' = 'void', -'args' = [ - { -'name' = 'p', -'type' = 'apr_pool_t *' - }, - { -'name' = 't', -'type' = 'ap_scoreboard_e' - } -], -'name' = 'ap_create_scoreboard' - }, - { -'return_type' = 'void', -'args' = [ - { -'name' = 'child_num', -'type' = 'int' - }, - { -'name' = 'thread_num', -'type' = 'int' - }, - { -'name' = 'r', -'type' = 'request_rec *' - } -], -'name' = 'ap_increment_counts' - }, - { -'return_type' = 'apr_status_t', -'args' = [ - { -'name' = 'd', -'type' = 'void *' - } -], -'name' = 'ap_cleanup_scoreboard' - }, - { -'return_type' = 'void', -'args' = [], -'name' = 'ap_sync_scoreboard_image' - }, - { -'return_type' = 'int', -'args' = [ - { -'name' = 'child_num', -'type' = 'int' - }, - { -'name' = 'thread_num', -'type' = 'int' - }, - { -'name' = 'status', -'type' = 'int' - }, - { -'name' = 'r', -'type' = 'request_rec *' - } -], -'name' = 'ap_update_child_status' - }, - { -'return_type' = 'void', -'args' = [ - { -'name' = 'child_num', -'type' = 'int' - }, - { -'name' = 'thread_num', -'type' = 'int' - }, - { -'name' = 'status', -'type' = 'int' - } -], -'name' = 'ap_time_process_request' - }, - { 'return_type' = 'void', 'args' = [ { @@ -9714,6 +9654,98 @@ } ], 'name' = 'ap_rfc1413' + }, + { +'return_type' = 'int
cvs commit: modperl-2.0/src/modules/perl modperl_callback.c modperl_handler.c modperl_handler.h
dougm 01/04/19 10:57:17 Modified:src/modules/perl modperl_callback.c modperl_handler.c modperl_handler.h Log: move handler resolver code into modperl_handler_resolve routine Revision ChangesPath 1.41 +3 -34 modperl-2.0/src/modules/perl/modperl_callback.c Index: modperl_callback.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- modperl_callback.c2001/04/13 01:10:20 1.40 +++ modperl_callback.c2001/04/19 17:57:14 1.41 @@ -6,41 +6,10 @@ CV *cv=Nullcv; I32 flags = G_EVAL|G_SCALAR; dSP; -int count, status, duped=0; +int count, status; -#ifdef USE_ITHREADS -if (p !MpHandlerPARSED(handler) !MpHandlerDYNAMIC(handler)) { -MP_dSCFG(s); -if (scfg-threaded_mpm) { -/* - * cannot update the handler structure at request time without - * locking, so just copy it - */ -handler = modperl_handler_dup(p, handler); -duped = 1; -} -} -#endif - -MP_TRACE_h_do(MpHandler_dump_flags(handler, handler-name)); - -if (!MpHandlerPARSED(handler)) { -apr_pool_t *rp = duped ? p : s-process-pconf; -MpHandlerAUTOLOAD_On(handler); - -MP_TRACE_h(MP_FUNC, - "handler %s was not compiled at startup, " - "attempting to resolve using %s pool 0x%lx\n", - handler-name, - duped ? "current" : "server conf", - (unsigned long)rp); - -if (!modperl_mgv_resolve(aTHX_ handler, rp, handler-name)) { -ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "failed to resolve handler `%s'", - handler-name); -return HTTP_INTERNAL_SERVER_ERROR; -} +if ((status = modperl_handler_resolve(aTHX_ handler, p, s)) != OK) { +return status; } ENTER;SAVETMPS; 1.9 +44 -0 modperl-2.0/src/modules/perl/modperl_handler.c Index: modperl_handler.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- modperl_handler.c 2001/04/12 03:24:45 1.8 +++ modperl_handler.c 2001/04/19 17:57:15 1.9 @@ -11,6 +11,50 @@ return handler; } +int modperl_handler_resolve(pTHX_ modperl_handler_t **handp, +apr_pool_t *p, server_rec *s) +{ +int duped=0; +modperl_handler_t *handler = *handp; + +#ifdef USE_ITHREADS +if (p !MpHandlerPARSED(handler) !MpHandlerDYNAMIC(handler)) { +MP_dSCFG(s); +if (scfg-threaded_mpm) { +/* + * cannot update the handler structure at request time without + * locking, so just copy it + */ +handler = *handp = modperl_handler_dup(p, handler); +duped = 1; +} +} +#endif + +MP_TRACE_h_do(MpHandler_dump_flags(handler, handler-name)); + +if (!MpHandlerPARSED(handler)) { +apr_pool_t *rp = duped ? p : s-process-pconf; +MpHandlerAUTOLOAD_On(handler); + +MP_TRACE_h(MP_FUNC, + "handler %s was not compiled at startup, " + "attempting to resolve using %s pool 0x%lx\n", + handler-name, + duped ? "current" : "server conf", + (unsigned long)rp); + +if (!modperl_mgv_resolve(aTHX_ handler, rp, handler-name)) { +ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, + "failed to resolve handler `%s'", + handler-name); +return HTTP_INTERNAL_SERVER_ERROR; +} +} + +return OK; +} + modperl_handler_t *modperl_handler_dup(apr_pool_t *p, modperl_handler_t *h) { 1.7 +3 -0 modperl-2.0/src/modules/perl/modperl_handler.h Index: modperl_handler.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- modperl_handler.h 2001/03/26 01:08:29 1.6 +++ modperl_handler.h 2001/04/19 17:57:15 1.7 @@ -21,6 +21,9 @@ modperl_handler_t *modperl_handler_new(apr_pool_t *p, const char *name); +int modperl_handler_
cvs commit: modperl-2.0/src/modules/perl mod_perl.c
dougm 01/04/19 11:08:10 Modified:src/modules/perl mod_perl.c Log: tidy a bit Revision ChangesPath 1.49 +12 -10modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- mod_perl.c2001/04/19 17:44:15 1.48 +++ mod_perl.c2001/04/19 18:08:08 1.49 @@ -263,12 +263,14 @@ void modperl_register_hooks(apr_pool_t *p) { -ap_hook_open_logs(modperl_hook_init, NULL, NULL, APR_HOOK_MIDDLE); +ap_hook_open_logs(modperl_hook_init, + NULL, NULL, APR_HOOK_MIDDLE); -ap_hook_post_config(modperl_hook_post_config, NULL, NULL, -APR_HOOK_MIDDLE); +ap_hook_post_config(modperl_hook_post_config, +NULL, NULL, APR_HOOK_MIDDLE); -ap_hook_handler(modperl_response_handler, NULL, NULL, APR_HOOK_MIDDLE); +ap_hook_handler(modperl_response_handler, +NULL, NULL, APR_HOOK_MIDDLE); ap_hook_insert_filter(modperl_output_filter_register, NULL, NULL, APR_HOOK_LAST); @@ -284,14 +286,14 @@ ap_hook_pre_connection(modperl_hook_pre_connection, NULL, NULL, APR_HOOK_FIRST); -ap_hook_create_request(modperl_hook_create_request, NULL, NULL, - APR_HOOK_MIDDLE); +ap_hook_create_request(modperl_hook_create_request, + NULL, NULL, APR_HOOK_MIDDLE); -ap_hook_post_read_request(modperl_hook_post_read_request, NULL, NULL, - APR_HOOK_FIRST); +ap_hook_post_read_request(modperl_hook_post_read_request, + NULL, NULL, APR_HOOK_FIRST); -ap_hook_header_parser(modperl_hook_header_parser, NULL, NULL, - APR_HOOK_FIRST); +ap_hook_header_parser(modperl_hook_header_parser, + NULL, NULL, APR_HOOK_FIRST); modperl_register_handler_hooks(); }
cvs commit: modperl-2.0/t/conf modperl_extra.pl
dougm 01/04/19 13:20:41 Modified:t/conf modperl_extra.pl Log: compile common APR constants Revision ChangesPath 1.4 +1 -0 modperl-2.0/t/conf/modperl_extra.pl Index: modperl_extra.pl === RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- modperl_extra.pl 2001/04/19 17:32:27 1.3 +++ modperl_extra.pl 2001/04/19 20:20:37 1.4 @@ -5,6 +5,7 @@ use Apache::Connection (); use Apache::Const -compile = ':common'; +use APR::Const -compile = ':common'; use APR::Table ();
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm TestConfigPerl.pm TestRequest.pm
dougm 01/04/19 14:21:20 Modified:Apache-Test/lib/Apache TestConfig.pm TestConfigPerl.pm TestRequest.pm Log: allow test modules to configure VirtualHosts and hit them with test requests Revision ChangesPath 1.9 +1 -1 modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm Index: TestConfig.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TestConfig.pm 2001/04/13 00:51:54 1.8 +++ TestConfig.pm 2001/04/19 21:21:16 1.9 @@ -564,7 +564,7 @@ $include_headers{$h} : $h; require Apache::TestRequest; -Apache::TestRequest::http_raw_get($self-{hostport}, +Apache::TestRequest::http_raw_get($self, $url, $ih); } 1.9 +7 -0 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm Index: TestConfigPerl.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TestConfigPerl.pm 2001/04/19 17:21:32 1.8 +++ TestConfigPerl.pm 2001/04/19 21:21:17 1.9 @@ -178,12 +178,19 @@ while ($fh) { next unless /\S+/; +chomp; $self-replace; my($directive, $rest) = split /\s+/, $_, 2; if ($outside_container{$directive}) { $self-postamble($directive = $rest); } elsif ($directive =~ m/^(\w+)/) { +if ($directive eq 'VirtualHost') { +$rest =~ s/$//; +my $port = $self-new_vhost($rest); +$self-postamble(Listen = $port); +$rest = "_default_:$port"; +} $self-postamble($directive = $rest); my $end = "/$1"; while ($fh) { 1.3 +15 -2 modperl-2.0/Apache-Test/lib/Apache/TestRequest.pm Index: TestRequest.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestRequest.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestRequest.pm2001/04/04 04:36:58 1.2 +++ TestRequest.pm2001/04/19 21:21:18 1.3 @@ -27,11 +27,23 @@ my $UA; my $Config; +sub hostport { +my $config = shift; +my $hostport = $config-{hostport}; + +if (my $module = $Apache::TestRequest::Module) { +$hostport = $config-{vhosts}-{$module}-{hostport}; +} + +$hostport; +} + sub resolve_url { my $url = shift; return $url if $url =~ m,^(\w+):/,; $url = "/$url" unless $url =~ m,^/,; -return "http://$Config-{hostport}$url"; +my $hostport = hostport($Config); +return "http://$hostport$url"; } my %wanted_args = map {$_, 1} qw(username password realm content); @@ -145,9 +157,10 @@ } sub http_raw_get { -my($hostport, $url, $want_headers) = @_; +my($config, $url, $want_headers) = @_; $url ||= "/"; +my $hostport = hostport($config); require IO::Socket; my $s = IO::Socket::INET-new($hostport);
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 01/04/19 14:26:47 Modified:src/modules/perl mod_perl.h modperl_filter.c modperl_mgv.c modperl_types.h t/conf modperl_extra.pl xs modperl_xs_util.h xs/Apache/Filter Apache__Filter.h xs/maps modperl_types.map xs/tables/current/ModPerl FunctionTable.pm Log: implement InputMessageFilters Revision ChangesPath 1.29 +5 -0 modperl-2.0/src/modules/perl/mod_perl.h Index: mod_perl.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- mod_perl.h2001/03/16 05:52:29 1.28 +++ mod_perl.h2001/04/19 21:26:34 1.29 @@ -41,4 +41,9 @@ void modperl_response_finish(request_rec *r); int modperl_response_handler(request_rec *r); +/* betting on Perl*Handlers not using CvXSUBANY + * mod_perl reuses this field for handler attributes + */ +#define MP_CODE_ATTRS(cv) (CvXSUBANY((CV*)cv).any_i32) + #endif /* MOD_PERL_H */ 1.14 +10 -2 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- modperl_filter.c 2001/04/19 17:58:25 1.13 +++ modperl_filter.c 2001/04/19 21:26:35 1.14 @@ -397,8 +397,16 @@ int i; for (i=0; iav-nelts; i++) { -modperl_filter_ctx_t *ctx = -(modperl_filter_ctx_t *)apr_pcalloc(c-pool, sizeof(*ctx)); +modperl_filter_ctx_t *ctx; + +if (!(handlers[i]-attrs MP_INPUT_FILTER_MESSAGE)) { +MP_TRACE_f(MP_FUNC, + "%s is not an InputFilterMessage handler\n", + handlers[i]-name); +continue; +} + +ctx = (modperl_filter_ctx_t *)apr_pcalloc(c-pool, sizeof(*ctx)); ctx-handler = handlers[i]; ap_add_input_filter(MODPERL_INPUT_FILTER_NAME, (void*)ctx, NULL, c); 1.13 +2 -0 modperl-2.0/src/modules/perl/modperl_mgv.c Index: modperl_mgv.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- modperl_mgv.c 2001/04/02 07:37:12 1.12 +++ modperl_mgv.c 2001/04/19 21:26:35 1.13 @@ -277,6 +277,7 @@ } else { if ((cv = get_cv(name, FALSE))) { +handler-attrs = (U32)MP_CODE_ATTRS(cv); handler-mgv_cv = modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(CvGV(cv; modperl_mgv_append(aTHX_ p, handler-mgv_cv, GvNAME(CvGV(cv))); @@ -331,6 +332,7 @@ } } +handler-attrs = (U32)MP_CODE_ATTRS(cv); /* note: this is the real function after @ISA lookup */ handler-mgv_cv = modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(gv))); modperl_mgv_append(aTHX_ p, handler-mgv_cv, handler_name); 1.36 +1 -0 modperl-2.0/src/modules/perl/modperl_types.h Index: modperl_types.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- modperl_types.h 2001/04/13 07:17:06 1.35 +++ modperl_types.h 2001/04/19 21:26:35 1.36 @@ -155,6 +155,7 @@ modperl_mgv_t *mgv_cv; const char *name; /* orignal name from .conf if any */ U8 flags; +U32 attrs; } modperl_handler_t; #define MP_HANDLER_TYPE_CHAR 1 1.5 +2 -0 modperl-2.0/t/conf/modperl_extra.pl Index: modperl_extra.pl === RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- modperl_extra.pl 2001/04/19 20:20:37 1.4 +++ modperl_extra.pl 2001/04/19 21:26:38 1.5 @@ -7,6 +7,8 @@ use Apache::Const -compile = ':common'; use APR::Const -compile = ':common'; +eval { require TestFilter::input_msg }; + use APR::Table (); sub ModPerl::Test::read_post { 1.6 +0 -2 modperl-2.0/xs/modperl_xs_util.h Index: modperl_xs_util.h === RCS file: /home/cvs/modperl-2.0/xs/modperl_xs_util.h,v retrieving revision 1.5 retrieving revision 1.6
cvs commit: modperl-2.0/t/filter/TestFilter input_msg.pm
dougm 01/04/19 14:28:04 Added: t/filter input_msg.t t/filter/TestFilter input_msg.pm Log: add test for InputFilterMessage handler Revision ChangesPath 1.1 modperl-2.0/t/filter/input_msg.t Index: input_msg.t === use Apache::TestRequest (); use Apache::TestConfig (); my $module = 'TestFilter::input_msg'; local $Apache::TestRequest::Module = $module; $Apache::TestRequest::Module ||= $module; #-w my $config = Apache::TestConfig-thaw; my $hostport = Apache::TestRequest::hostport($config); print "connecting to $hostport\n"; print $config-http_raw_get("/input_filter.html"); 1.1 modperl-2.0/t/filter/TestFilter/input_msg.pm Index: input_msg.pm === package TestFilter::input_msg; use strict; use warnings FATAL = 'all'; use base qw(Apache::Filter); use Test; use Apache::Test (); use APR::Brigade (); use APR::Bucket (); #XXX @Apache::InputFilter::ISA = qw(Apache::OutputFilter); my $from_url = '/input_filter.html'; my $to_url = '/TestFilter::input_msg::response'; sub handler : InputFilterMessage { my($filter, $bb, $mode) = @_; if ($bb-empty) { my $rv = $filter-f-next-get_brigade($bb, $mode); if ($rv != APR::SUCCESS) { return $rv; } } for (my $bucket = $bb-first; $bucket; $bucket = $bb-next($bucket)) { my $data; my $status = $bucket-read($data); $bucket-remove; if ($data and $data =~ s,GET $from_url,GET $to_url,) { $bb-insert_tail(APR::Bucket-new($data)); } else { $bb-insert_tail($bucket); } } Apache::OK; } sub response { my $r = shift; $r-content_type('text/plain'); $r-puts("1..1\nok 1\n"); Apache::OK; } 1; __DATA__ VirtualHost TestFilter::input_msg PerlInputFilterHandler TestFilter::input_msg Location /TestFilter::input_msg::response SetHandler modperl PerlResponseHandler TestFilter::input_msg::response /Location /VirtualHost
cvs commit: modperl-2.0/src/modules/perl modperl_filter.c modperl_filter.h
dougm 01/04/19 17:43:47 Modified:src/modules/perl modperl_filter.c modperl_filter.h Log: remove dead code Revision ChangesPath 1.16 +0 -11 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- modperl_filter.c 2001/04/20 00:38:08 1.15 +++ modperl_filter.c 2001/04/20 00:43:47 1.16 @@ -122,17 +122,6 @@ return status; } -MP_INLINE modperl_filter_t *modperl_sv2filter(pTHX_ SV *sv) -{ -modperl_filter_t *filter = NULL; - -if (SvROK(sv) (SvTYPE(SvRV(sv)) == SVt_PVMG)) { -filter = (modperl_filter_t *)SvIV((SV*)SvRV(sv)); -} - -return filter; -} - /* output filters */ MP_INLINE static apr_status_t send_eos(ap_filter_t *f) 1.5 +0 -2 modperl-2.0/src/modules/perl/modperl_filter.h Index: modperl_filter.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- modperl_filter.h 2001/04/20 00:38:08 1.4 +++ modperl_filter.h 2001/04/20 00:43:47 1.5 @@ -27,8 +27,6 @@ int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode); -MP_INLINE modperl_filter_t *modperl_sv2filter(pTHX_ SV *sv); - /* output filters */ apr_status_t modperl_output_filter_handler(ap_filter_t *f, apr_bucket_brigade *bb);
cvs commit: modperl-2.0/t/filter/TestFilter input_body.pm input_msg.pm
dougm 01/04/19 18:21:29 Modified:t/filter/TestFilter input_body.pm input_msg.pm Log: remove filter ISA relationship, Input/Output classes are dead Revision ChangesPath 1.3 +0 -3 modperl-2.0/t/filter/TestFilter/input_body.pm Index: input_body.pm === RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_body.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- input_body.pm 2001/04/20 00:38:09 1.2 +++ input_body.pm 2001/04/20 01:21:28 1.3 @@ -12,9 +12,6 @@ use APR::Brigade (); use APR::Bucket (); -#XXX -@Apache::InputFilter::ISA = qw(Apache::OutputFilter); - sub handler : InputFilterBody { my($filter, $bb, $mode) = @_; 1.3 +0 -3 modperl-2.0/t/filter/TestFilter/input_msg.pm Index: input_msg.pm === RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_msg.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- input_msg.pm 2001/04/20 00:38:09 1.2 +++ input_msg.pm 2001/04/20 01:21:28 1.3 @@ -10,9 +10,6 @@ use APR::Brigade (); use APR::Bucket (); -#XXX -@Apache::InputFilter::ISA = qw(Apache::OutputFilter); - my $from_url = '/input_filter.html'; my $to_url = '/TestFilter::input_msg::response';
cvs commit: modperl-2.0/xs/maps modperl_functions.map
dougm 01/04/19 18:57:26 Modified:src/modules/perl modperl_util.c modperl_util.h t/filter/TestFilter api.pm xs/Apache/Filter Apache__Filter.h xs/maps modperl_functions.map Log: add Apache::Filter::{TIEHANDLE,PRINT} methods Revision ChangesPath 1.7 +19 -0 modperl-2.0/src/modules/perl/modperl_util.c Index: modperl_util.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- modperl_util.c2001/04/09 23:57:22 1.6 +++ modperl_util.c2001/04/20 01:57:25 1.7 @@ -33,6 +33,25 @@ return r; } +MP_INLINE SV *modperl_newSVsv_obj(pTHX_ SV *stashsv, SV *obj) +{ +SV *newobj; + +if (!obj) { +obj = stashsv; +stashsv = Nullsv; +} + +newobj = newSVsv(obj); + +if (stashsv) { +HV *stash = gv_stashsv(stashsv, TRUE); +return sv_bless(newobj, stash); +} + +return newobj; +} + MP_INLINE SV *modperl_ptr2obj(pTHX_ char *classname, void *ptr) { SV *sv = newSV(0); 1.8 +2 -0 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- modperl_util.h2001/04/09 23:57:22 1.7 +++ modperl_util.h2001/04/20 01:57:25 1.8 @@ -16,6 +16,8 @@ MP_INLINE request_rec *modperl_sv2request_rec(pTHX_ SV *sv); +MP_INLINE SV *modperl_newSVsv_obj(pTHX_ SV *stashsv, SV *obj); + MP_INLINE SV *modperl_ptr2obj(pTHX_ char *classname, void *ptr); #define modperl_bless_request_rec(r) \ 1.3 +0 -9 modperl-2.0/t/filter/TestFilter/api.pm Index: api.pm === RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/api.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- api.pm2001/04/20 00:38:09 1.2 +++ api.pm2001/04/20 01:57:26 1.3 @@ -13,15 +13,6 @@ sub init_test_pm { my $filter = shift; -{ -package Apache::Filter; -#XXX: make part of standard api? -unless (defined PRINT) { -*PRINT = \print; -*TIEHANDLE = sub { shift }; -} -} - tie *STDOUT, $filter; $Test::TESTOUT = \*STDOUT; 1.7 +5 -0 modperl-2.0/xs/Apache/Filter/Apache__Filter.h Index: Apache__Filter.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Apache__Filter.h 2001/04/20 00:38:10 1.6 +++ Apache__Filter.h 2001/04/20 01:57:26 1.7 @@ -6,6 +6,11 @@ || (Perl_croak(aTHX_ "argument is not a blessed reference"),0) ? \ modperl_filter_mg_get(aTHX_ sv) : NULL) +#define mpxs_Apache__Filter_TIEHANDLE(stashsv, sv) \ +modperl_newSVsv_obj(aTHX_ stashsv, sv) + +#define mpxs_Apache__Filter_PRINT mpxs_Apache__Filter_print + static MP_INLINE apr_size_t mpxs_Apache__Filter_print(pTHX_ I32 items, SV **MARK, SV **SP) { 1.5 +3 -0 modperl-2.0/xs/maps/modperl_functions.map Index: modperl_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- modperl_functions.map 2001/04/20 00:38:11 1.4 +++ modperl_functions.map 2001/04/20 01:57:26 1.5 @@ -24,3 +24,6 @@ mpxs_Apache__Filter_print | | ... mpxs_Apache__Filter_read | | ... + + SV *:DEFINE_TIEHANDLE | | SV *:stashsv, SV *:sv=Nullsv + int:DEFINE_PRINT | | ...
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 01/04/19 20:03:41 Modified:xs/tables/current/ModPerl FunctionTable.pm Log: sync Revision ChangesPath 1.7 +19 -29modperl-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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- FunctionTable.pm 2001/04/20 00:38:11 1.6 +++ FunctionTable.pm 2001/04/20 03:03:40 1.7 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Thu Apr 19 17:22:38 2001 +# ! Thu Apr 19 19:14:01 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -286,6 +286,24 @@ 'type' = 'PerlInterpreter *' }, { +'name' = 'stashsv', +'type' = 'SV *' + }, + { +'name' = 'obj', +'type' = 'SV *' + } +], +'name' = 'modperl_newSVsv_obj' + }, + { +'return_type' = 'SV *', +'args' = [ + { +'name' = 'my_perl', +'type' = 'PerlInterpreter *' + }, + { 'name' = 'classname', 'type' = 'char *' }, @@ -1923,20 +1941,6 @@ 'name' = 'modperl_run_filter' }, { -'return_type' = 'modperl_filter_t *', -'args' = [ - { -'name' = 'my_perl', -'type' = 'PerlInterpreter *' - }, - { -'name' = 'sv', -'type' = 'SV *' - } -], -'name' = 'modperl_sv2filter' - }, - { 'return_type' = 'apr_status_t', 'args' = [ { @@ -3133,20 +3137,6 @@ } ], 'name' = 'mpxs_ap_get_client_block' - }, - { -'return_type' = 'request_rec *', -'args' = [ - { -'name' = 'classname', -'type' = 'SV *' - }, - { -'name' = 'r', -'type' = 'request_rec *' - } -], -'name' = 'mpxs_Apache__RequestRec_TIEHANDLE' } ];
cvs commit: modperl-2.0/xs/maps modperl_functions.map
dougm 01/04/19 20:07:55 Modified:Apache-Test/lib/Apache Test.pm lib/Apache compat.pm lib/ModPerl FunctionMap.pm WrapXS.pm xs/Apache/RequestIO Apache__RequestIO.h xs/maps modperl_functions.map Log: better implementation of Apache::RequestRec::TIEHANDLE add Apache::RequestRec::PRINT alias expand DEFINE_* prefixes in ModPerl::FunctionTable to avoid name clashes Revision ChangesPath 1.4 +2 -6 modperl-2.0/Apache-Test/lib/Apache/Test.pm Index: Test.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/Test.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Test.pm 2001/04/18 04:36:56 1.3 +++ Test.pm 2001/04/20 03:07:52 1.4 @@ -20,12 +20,8 @@ sub init_test_pm { my $r = shift; -if (defined Apache::RequestRec::puts) { -package Apache::RequestRec; -unless (defined PRINT) { -*PRINT = \puts; -} -tie *STDOUT, __PACKAGE__, $r; +if (defined Apache::RequestRec::TIEHANDLE) { +tie *STDOUT, $r; } else { $r-send_http_header; #1.xx 1.2 +0 -4 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- compat.pm 2001/04/12 03:56:49 1.1 +++ compat.pm 2001/04/20 03:07:53 1.2 @@ -64,10 +64,6 @@ untie *STDOUT; tie *STDOUT, 'Apache::RequestRec', $r; -unless (defined PRINT) { -*PRINT = \puts; -} - $Request; } 1.6 +14 -8 modperl-2.0/lib/ModPerl/FunctionMap.pm Index: FunctionMap.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/FunctionMap.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FunctionMap.pm2001/04/04 17:12:07 1.5 +++ FunctionMap.pm2001/04/20 03:07:53 1.6 @@ -122,14 +122,6 @@ next; } -my $entry = $map-{$name} = { - name= $alias || $name, - dispatch= $dispatch, - argspec = $argspec ? [split /\s*,\s*/, $argspec] : "", - return_type = $return_type, - alias = $alias, -}; - if (my $package = $cur{PACKAGE}) { unless ($package eq 'guess') { $cur{CLASS} = $package; @@ -141,6 +133,20 @@ else { $cur{CLASS} = $cur{MODULE}; } + +#XXX: make_prefix() stuff should be here, not ModPerl::WrapXS +if ($name =~ /^DEFINE_/ and $cur{CLASS}) { +$name =~ s{^(DEFINE_)(.*)} + {$1 . ModPerl::WrapXS::make_prefix($2, $cur{CLASS})}e; +} + +my $entry = $map-{$name} = { + name= $alias || $name, + dispatch= $dispatch, + argspec = $argspec ? [split /\s*,\s*/, $argspec] : "", + return_type = $return_type, + alias = $alias, +}; for (keys %cur) { $entry-{lc $_} = $cur{$_}; 1.7 +1 -0 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WrapXS.pm 2001/04/19 17:24:43 1.6 +++ WrapXS.pm 2001/04/20 03:07:53 1.7 @@ -348,6 +348,7 @@ sub make_prefix { my($name, $class) = @_; my $class_prefix = class_mpxs_prefix($class); +return $name if $name =~ /^$class_prefix/; $class_prefix . $name; } 1.5 +5 -7 modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h Index: Apache__RequestIO.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Apache__RequestIO.h 2001/03/27 04:40:36 1.4 +++ Apache__RequestIO.h 2001/04/20 03:07:54 1.5 @@ -1,3 +1,8 @@ +#define mpxs_Apache__RequestRec_TIEHANDLE(stashsv, sv) \ +modperl_newSVsv_obj(aTHX_ stashsv, sv) + +#define mpxs_Apache__RequestRec_PRINT mpxs_ap_rvputs + #if 0 #define MP_USE_AP_RWRITE #endif @@ -66,11 +71,4 @@ } return nrd; -} - -static MP_INLINE -request_rec *mpxs_Apache__RequestRec_TIEHANDLE(SV *classname, - request_rec *r)
cvs commit: modperl-2.0/xs/maps apache_structures.map
dougm 01/04/18 08:53:25 Modified:xs/maps apache_structures.map Log: keepalive has moved out of the conn_rec Revision ChangesPath 1.4 +0 -2 modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- apache_structures.map 2001/04/13 07:17:08 1.3 +++ apache_structures.map 2001/04/18 15:53:22 1.4 @@ -105,8 +105,6 @@ remote_host remote_logname aborted - keepalive - keptalive ? double_reverse keepalives local_ip
cvs commit: modperl-2.0/t/response/TestAPI conn_rec.pm
dougm 01/04/18 22:46:04 Modified:t/response/TestAPI conn_rec.pm Log: remove tests for stuff moved out of conn_rec Revision ChangesPath 1.3 +1 -5 modperl-2.0/t/response/TestAPI/conn_rec.pm Index: conn_rec.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/conn_rec.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- conn_rec.pm 2001/04/03 16:59:08 1.2 +++ conn_rec.pm 2001/04/19 05:46:04 1.3 @@ -10,7 +10,7 @@ my $c = $r-connection; -plan $r, tests = 17; +plan $r, tests = 15; ok $c; @@ -33,10 +33,6 @@ ok $c-aborted || 1; ok $c-keepalive || 1; - -ok $c-keptalive || 1; - -ok $c-keepalives || 1; ok $c-local_ip;
cvs commit: modperl Changes
dougm 01/04/17 14:30:09 Modified:src/modules/perl perl_util.c .Changes Log: make sure global for Apache-request is reset after configuring %ENV Revision ChangesPath 1.46 +2 -0 modperl/src/modules/perl/perl_util.c Index: perl_util.c === RCS file: /home/cvs/modperl/src/modules/perl/perl_util.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- perl_util.c 2001/02/16 23:30:28 1.45 +++ perl_util.c 2001/04/17 21:30:02 1.46 @@ -610,6 +610,8 @@ add_common_vars(r); add_cgi_vars(r); +/* resetup global request rec, because it may set to an (invalid) subrequest by ap_add_cgi_vars */ +perl_request_rec(r); if (!table_get(envtab, "TZ")) { if ((tz = getenv("TZ")) != NULL) { 1.582 +3 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.581 retrieving revision 1.582 diff -u -r1.581 -r1.582 --- Changes 2001/02/16 23:30:23 1.581 +++ Changes 2001/04/17 21:30:06 1.582 @@ -10,6 +10,9 @@ =item 1.25_01-dev +make sure global for Apache-request is reset after configuring %ENV +[Gerald Richter [EMAIL PROTECTED]] + adjust 'U' magic functions to Perl 5.7.x-dev prototype change Put Apache's CFLAGS into AP_CFLAGS instead of CFLAGS, so that
cvs commit: modperl/src/modules/perl mod_perl.c
dougm 01/04/17 15:01:20 Modified:.Changes src/modules/perl mod_perl.c Log: back out 'stop win32 crash when bringing down service' change, no longer needed with 1.3.19 Revision ChangesPath 1.586 +4 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.585 retrieving revision 1.586 diff -u -r1.585 -r1.586 --- Changes 2001/04/17 21:57:17 1.585 +++ Changes 2001/04/17 22:01:13 1.586 @@ -10,6 +10,10 @@ =item 1.25_01-dev +back out 'stop win32 crash when bringing down service' change, no +longer needed with 1.3.19 +[John Sterling, Will Rowe] + $r-no_cache(0) will unset cache headers [Geoffrey Young [EMAIL PROTECTED]] 1.136 +0 -12 modperl/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.135 retrieving revision 1.136 diff -u -r1.135 -r1.136 --- mod_perl.c2001/02/16 23:30:27 1.135 +++ mod_perl.c2001/04/17 22:01:18 1.136 @@ -509,18 +509,6 @@ { array_header *librefs; -#ifdef WIN32 -// This is here to stop a crash when bringing down -// a service. Apparently the dso is unloaded too early. -// This if statement tests to see if we are running as a -// service. apache does the same -// see apache's isProcessService() in service.c -if (AllocConsole()) { -FreeConsole(); -return; -} -#endif - librefs = xs_dl_librefs((pool *)data); perl_shutdown(NULL, NULL); unload_xs_so(librefs);
cvs commit: modperl Changes Makefile.PL
dougm 01/04/17 15:39:09 Modified:.Changes Makefile.PL Log: improve Apache::MyConfig Revision ChangesPath 1.587 +2 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.586 retrieving revision 1.587 diff -u -r1.586 -r1.587 --- Changes 2001/04/17 22:01:13 1.586 +++ Changes 2001/04/17 22:39:06 1.587 @@ -10,6 +10,8 @@ =item 1.25_01-dev +improve Apache::MyConfig [Stas Bekman [EMAIL PROTECTED]] + back out 'stop win32 crash when bringing down service' change, no longer needed with 1.3.19 [John Sterling, Will Rowe] 1.180 +18 -15modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.179 retrieving revision 1.180 diff -u -r1.179 -r1.180 --- Makefile.PL 2001/04/17 21:38:52 1.179 +++ Makefile.PL 2001/04/17 22:39:07 1.180 @@ -95,6 +95,7 @@ $Apache::MyConfig::Setup{Apache_Src} ; my $PWD = cwd; +$ENV{APACHE_CWD} = $PWD; $ENV{PERL5LIB} = "$PWD/lib"; my %SSL = ( @@ -1977,9 +1978,23 @@ EOS } -local *FH; -# writing Configuration to Apache::MyConfig +# preparing and writing Configuration to Apache::MyConfig +my %my_config = %callback_hooks; +my @other_hooks = qw(APACHE_SRC SSL_BASE APXS PERL_USELARGEFILES + PERL_TRACE PERL_DEBUG APACI_ARGS APACHE_PREFIX + DO_HTTPD NO_HTTPD PREP_HTTPD USE_APACI + APACHE_HEADER_INSTALL PERL_STATIC_EXTS ); +{ +no strict 'refs'; +$my_config{$_} = ${$_} for @other_hooks; +} +my $my_config_dump = join ",\n", +map { qq{'$_' = } . + ($my_config{$_} =~ /^\d+$/ ? $my_config{$_} : qq{'$my_config{$_}'}) +} sort keys %my_config; + +local *FH; open FH, 'lib/Apache/MyConfig.pm' || die "Can't open lib/Apache/MyConfig.pm: $!"; print FH EOT; @@ -1989,20 +2004,8 @@ package Apache::MyConfig; %Setup = ( - 'Apache_Src' = \'$APACHE_SRC\', - 'SSL_BASE' = \'$SSL_BASE\', - 'APXS' = \'$WITH_APXS\', - 'PERL_USELARGEFILES' = \'$PERL_USELARGEFILES\', -EOT - - foreach my $key (sort @callback_hooks) { -print FH " \'$key\' = \'$callback_hooks{$key}\',\n"; - } - - print FH EOT; - $string +$my_config_dump ); - 1; __END__
cvs commit: modperl Makefile.PL
dougm 01/04/17 15:42:05 Modified:.Makefile.PL Log: need this alias for Apache::src backwards compat Revision ChangesPath 1.181 +3 -0 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.180 retrieving revision 1.181 diff -u -r1.180 -r1.181 --- Makefile.PL 2001/04/17 22:39:07 1.180 +++ Makefile.PL 2001/04/17 22:42:03 1.181 @@ -1989,6 +1989,9 @@ $my_config{$_} = ${$_} for @other_hooks; } +#need this alias for Apache::src backwards compat +$my_config{'Apache_Src'} = $my_config{'APACHE_SRC'}; + my $my_config_dump = join ",\n", map { qq{'$_' = } . ($my_config{$_} =~ /^\d+$/ ? $my_config{$_} : qq{'$my_config{$_}'})
cvs commit: modperl Makefile.PL Changes
dougm 01/04/17 14:38:55 Modified:.Makefile.PL Changes Log: fix 'make tar_Apache' Revision ChangesPath 1.179 +1 -1 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.178 retrieving revision 1.179 diff -u -r1.178 -r1.179 --- Makefile.PL 2001/01/29 17:43:21 1.178 +++ Makefile.PL 2001/04/17 21:38:52 1.179 @@ -1385,7 +1385,7 @@ tar_Apache: (cd $(INSTALLSITELIB)/$(ARCHNAME); \ - $(TAR) -cf $(PWD)/Apache.tar mod_perl.pm Apache.pm Apache $(ARCHNAME)/auto/Apache; ) +$(TAR) -cf $(PWD)/Apache.tar mod_perl.pm Apache.pm Apache auto/Apache; ) offsite-tar: $(CP) MANIFEST MANIFEST.orig 1.583 +2 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.582 retrieving revision 1.583 diff -u -r1.582 -r1.583 --- Changes 2001/04/17 21:30:06 1.582 +++ Changes 2001/04/17 21:38:52 1.583 @@ -10,6 +10,8 @@ =item 1.25_01-dev +fix 'make tar_Apache' [Geoffrey Young [EMAIL PROTECTED]] + make sure global for Apache-request is reset after configuring %ENV [Gerald Richter [EMAIL PROTECTED]]
cvs commit: modperl/apaci mod_perl.exp
dougm 01/04/17 14:48:57 Modified:.Changes src/modules/win32 mod_perl.def apacimod_perl.exp Log: export hvrv2table (needed by Apache::Request) for aix and win32 Revision ChangesPath 1.584 +3 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.583 retrieving revision 1.584 diff -u -r1.583 -r1.584 --- Changes 2001/04/17 21:38:52 1.583 +++ Changes 2001/04/17 21:48:49 1.584 @@ -10,6 +10,9 @@ =item 1.25_01-dev +export hvrv2table (needed by Apache::Request) for aix and win32 +[Jens-Uwe Mager [EMAIL PROTECTED], Randy Kobes [EMAIL PROTECTED]] + fix 'make tar_Apache' [Geoffrey Young [EMAIL PROTECTED]] make sure global for Apache-request is reset after configuring %ENV 1.2 +1 -0 modperl/src/modules/win32/mod_perl.def Index: mod_perl.def === RCS file: /home/cvs/modperl/src/modules/win32/mod_perl.def,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mod_perl.def 2000/12/31 19:34:16 1.1 +++ mod_perl.def 2001/04/17 21:48:52 1.2 @@ -10,5 +10,6 @@ perl_cmd_perl_TAKE1 perl_cmd_perl_TAKE123 perl_perl_cmd_cleanup + hvrv2table 1.3 +1 -0 modperl/apaci/mod_perl.exp Index: mod_perl.exp === RCS file: /home/cvs/modperl/apaci/mod_perl.exp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_perl.exp 2000/03/03 22:20:18 1.2 +++ mod_perl.exp 2001/04/17 21:48:55 1.3 @@ -4,3 +4,4 @@ mod_perl_tie_table sv2request_rec perl_request_rec +hvrv2table
cvs commit: modperl-2.0/Apache-Test/lib/Apache Test.pm
dougm 01/04/17 21:36:58 Modified:Apache-Test/lib/Apache Test.pm Log: add Apache::TestToString class for feeding Test.pm output into a string Revision ChangesPath 1.3 +34 -3 modperl-2.0/Apache-Test/lib/Apache/Test.pm Index: Test.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/Test.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Test.pm 2001/04/04 04:36:57 1.2 +++ Test.pm 2001/04/18 04:36:56 1.3 @@ -11,6 +11,12 @@ our $VERSION = '0.01'; #so Perl's Test.pm can be run inside mod_perl +sub test_pm_refresh { +$Test::TESTOUT = \*STDOUT; +$Test::planned = 0; +$Test::ntest = 1; +} + sub init_test_pm { my $r = shift; @@ -27,9 +33,7 @@ $r-content_type('text/plain'); -$Test::TESTOUT = \*STDOUT; -$Test::planned = 0; -$Test::ntest = 1; +test_pm_refresh(); } sub plan { @@ -51,6 +55,33 @@ } Test::plan(@_); +} + +package Apache::TestToString; + +sub TIEHANDLE { +my $string = ""; +bless \$string; +} + +sub PRINT { +my $string = shift; +$$string .= join '', @_; +} + +sub start { +tie *STDOUT, __PACKAGE__; +Apache::Test::test_pm_refresh(); +} + +sub finish { +my $s; +{ +my $o = tied *STDOUT; +$s = $$o; +} +untie *STDOUT; +$s; } 1;
cvs commit: modperl-2.0/src/modules/perl modperl_filter.c
dougm 01/04/17 21:37:47 Modified:src/modules/perl modperl_filter.c Log: pass the APR::Brigade to filter handlers Revision ChangesPath 1.11 +1 -0 modperl-2.0/src/modules/perl/modperl_filter.c Index: modperl_filter.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- modperl_filter.c 2001/03/16 07:30:22 1.10 +++ modperl_filter.c 2001/04/18 04:37:46 1.11 @@ -95,6 +95,7 @@ modperl_handler_make_args(aTHX_ args, filter_classes[filter-mode], filter, + "APR::Brigade", filter-bb, NULL); if ((status = modperl_callback(aTHX_ handler, p, s, args)) != OK) {
cvs commit: modperl-2.0/lib/ModPerl Code.pm
dougm 01/04/17 21:40:02 Modified:lib/ModPerl Code.pm Log: include modperl_bucket Revision ChangesPath 1.57 +1 -1 modperl-2.0/lib/ModPerl/Code.pm Index: Code.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- Code.pm 2001/04/11 23:00:59 1.56 +++ Code.pm 2001/04/18 04:40:00 1.57 @@ -520,7 +520,7 @@ ); my @c_src_names = qw(interp tipool log config cmd options callback handler - gtop util filter mgv pcw); + gtop util filter bucket mgv pcw); my @g_c_names = map { "modperl_$_" } qw(hooks directives flags xsinit); my @c_names = ('mod_perl', (map "modperl_$_", @c_src_names)); sub c_files { [map { "$_.c" } @c_names, @g_c_names] }
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 01/04/17 21:42:54 Modified:xs/tables/current/Apache ConstantsTable.pm FunctionTable.pm StructureTable.pm xs/tables/current/ModPerl FunctionTable.pm Log: sync generated tables Revision ChangesPath 1.4 +1 -1 modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm Index: ConstantsTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ConstantsTable.pm 2001/04/12 00:59:21 1.3 +++ ConstantsTable.pm 2001/04/18 04:42:50 1.4 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Wed Apr 11 17:57:08 2001 +# ! Mon Apr 16 18:17:25 2001 # ! do NOT edit, any changes will be lost ! # !! 1.2 +117 -300 modperl-2.0/xs/tables/current/Apache/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FunctionTable.pm 2001/03/26 16:05:47 1.1 +++ FunctionTable.pm 2001/04/18 04:42:50 1.2 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Mon Mar 26 07:44:02 2001 +# ! Tue Apr 17 21:37:29 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -436,6 +436,24 @@ { 'name' = 'input', 'type' = 'apr_time_t' + }, + { +'name' = 'offs', +'type' = 'apr_int32_t' + } +], +'name' = 'apr_explode_time' + }, + { +'return_type' = 'apr_status_t', +'args' = [ + { +'name' = 'result', +'type' = 'apr_exploded_time_t *' + }, + { +'name' = 'input', +'type' = 'apr_time_t' } ], 'name' = 'apr_explode_gmt' @@ -636,6 +654,24 @@ 'return_type' = 'apr_status_t', 'args' = [ { +'name' = 'rootpath', +'type' = 'const char **' + }, + { +'name' = 'filepath', +'type' = 'const char **' + }, + { +'name' = 'p', +'type' = 'apr_pool_t *' + } +], +'name' = 'apr_filepath_root' + }, + { +'return_type' = 'apr_status_t', +'args' = [ + { 'name' = 'newpath', 'type' = 'char **' }, @@ -662,6 +698,34 @@ 'return_type' = 'apr_status_t', 'args' = [ { +'name' = 'path', +'type' = 'char **' + }, + { +'name' = 'p', +'type' = 'apr_pool_t *' + } +], +'name' = 'apr_filepath_get' + }, + { +'return_type' = 'apr_status_t', +'args' = [ + { +'name' = 'path', +'type' = 'const char *' + }, + { +'name' = 'p', +'type' = 'apr_pool_t *' + } +], +'name' = 'apr_filepath_set' + }, + { +'return_type' = 'apr_status_t', +'args' = [ + { 'name' = 'new_file', 'type' = 'apr_file_t **' }, @@ -740,16 +804,6 @@ 'return_type' = 'apr_status_t', 'args' = [ { -'name' = 'fptr', -'type' = 'apr_file_t *' - } -], -'name' = 'apr_file_error' - }, - { -'return_type' = 'apr_status_t', -'args' = [ - { 'name' = 'thefile', 'type' = 'apr_file_t **' }, @@ -2600,7 +2654,7 @@ 'type' = 'apr_int32_t' } ], -'name' = 'apr_threadattr_detach_get' +'name' = 'apr_threadattr_detach_set' }, { 'return_type' = 'apr_status_t', @@ -2610,7 +2664,7 @@ 'type' = 'apr_threadattr_t *' } ], -'name' = 'apr_threadattr_detach_set' +'name' = 'apr_threadattr_detach_get' }, { 'return_type' = 'apr_status_t', @@ -3149,24 +3203,12 @@ { 'return_type' = 'apr_status_t', 'args' = [ - { -'name' = 'td', -'type' = 'apr_thread_t **' - }, - { -'name' = 'tattr', -'type' = 'apr_threadattr_t *' - }, { -'name' = 'arg2', -'type' = 'int (*signal_handler)(int signum)' - }, - { -'name' = 'p', -'type' = 'apr_pool_t *' +'name' = 'arg0', +'type' = 'int(*signal_handler)(int signum
cvs commit: modperl-2.0/xs/APR/Brigade APR__Brigade.h
dougm 01/04/17 22:09:56 Modified:xs/APR/Brigade APR__Brigade.h Log: add some APR::Brigade methods Revision ChangesPath 1.2 +59 -2 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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- APR__Brigade.h2001/03/05 03:53:28 1.1 +++ APR__Brigade.h2001/04/18 05:09:56 1.2 @@ -1,5 +1,62 @@ -static MP_INLINE apr_bucket_brigade *mpxs_apr_brigade_create(pTHX_ SV *CLASS, - apr_pool_t *p) +static MP_INLINE +apr_bucket_brigade *mpxs_apr_brigade_create(pTHX_ SV *CLASS, +apr_pool_t *p) { return apr_brigade_create(p); } + +#define get_brigade(brigade, fetch) \ +(fetch(brigade) == APR_BRIGADE_SENTINEL(brigade) ? \ + NULL : fetch(brigade)) + +static MP_INLINE +apr_bucket *mpxs_APR__Brigade_first(apr_bucket_brigade *brigade) +{ +return get_brigade(brigade, APR_BRIGADE_FIRST); +} + +static MP_INLINE +apr_bucket *mpxs_APR__Brigade_last(apr_bucket_brigade *brigade) +{ +return get_brigade(brigade, APR_BRIGADE_LAST); +} + +#define get_bucket(brigade, bucket, fetch) \ +(fetch(bucket) == APR_BRIGADE_SENTINEL(brigade) ? \ + NULL : fetch(bucket)) + +static MP_INLINE +apr_bucket *mpxs_APR__Brigade_next(apr_bucket_brigade *brigade, +apr_bucket *bucket) +{ +return get_bucket(brigade, bucket, APR_BUCKET_NEXT); +} + +static MP_INLINE +apr_bucket *mpxs_APR__Brigade_prev(apr_bucket_brigade *brigade, + apr_bucket *bucket) +{ +return get_bucket(brigade, bucket, APR_BUCKET_PREV); +} + +static MP_INLINE +void mpxs_APR__Brigade_insert_tail(apr_bucket_brigade *brigade, + apr_bucket *bucket) +{ +APR_BRIGADE_INSERT_TAIL(brigade, bucket); +} + +static MP_INLINE +void mpxs_APR__Brigade_insert_head(apr_bucket_brigade *brigade, + apr_bucket *bucket) +{ +APR_BRIGADE_INSERT_HEAD(brigade, bucket); +} + +static MP_INLINE +void mpxs_APR__Brigade_concat(apr_bucket_brigade *a, + apr_bucket_brigade *b) +{ +APR_BRIGADE_CONCAT(a, b); +} +
cvs commit: modperl-2.0/xs/maps apr_functions.map apr_structures.map apr_types.map
dougm 01/04/17 22:10:44 Modified:xs/maps apr_functions.map apr_structures.map apr_types.map Log: enable APR::Bucket module, add some APR::Brigade methods Revision ChangesPath 1.7 +46 -31modperl-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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- apr_functions.map 2001/04/12 05:38:25 1.6 +++ apr_functions.map 2001/04/18 05:10:43 1.7 @@ -75,38 +75,53 @@ apr_brigade_write apr_brigade_puts apr_brigade_putc + mpxs_APR__Brigade_first#APR_BRIGADE_FIRST + mpxs_APR__Brigade_last #APR_BRIGADE_LAST + mpxs_APR__Brigade_prev #APR_BUCKET_PREV + mpxs_APR__Brigade_next #APR_BUCKET_NEXT + mpxs_APR__Brigade_insert_tail #APR_BRIGADE_INSERT_TAIL + mpxs_APR__Brigade_insert_head #APR_BRIGADE_INSERT_HEAD + mpxs_APR__Brigade_concat #APR_BRIGADE_CONCAT -!MODULE=APR::Bucket - apr_bucket_copy_notimpl - apr_bucket_shared_copy - apr_bucket_eos_create - apr_bucket_file_create - apr_bucket_flush_create - apr_bucket_heap_create - apr_bucket_immortal_create - apr_bucket_mmap_create - apr_bucket_pipe_create - apr_bucket_pool_create - apr_bucket_socket_create - apr_bucket_transient_create - apr_bucket_destroy_notimpl - apr_bucket_shared_destroy - apr_bucket_eos_make - apr_bucket_file_make - apr_bucket_flush_make - apr_bucket_heap_make - apr_bucket_immortal_make - apr_bucket_mmap_make - apr_bucket_pipe_make - apr_bucket_pool_make - apr_bucket_shared_make - apr_bucket_socket_make - apr_bucket_transient_make - apr_bucket_setaside_notimpl - apr_bucket_split_notimpl - apr_bucket_shared_split - apr_bucket_simple_split - apr_bucket_simple_copy +MODULE=APR::Bucket + mpxs_APR__Bucket_is_eos #APR_BUCKET_IS_EOS + mpxs_APR__Bucket_insert_after #APR_BUCKET_INSERT_AFTER + mpxs_APR__Bucket_insert_before #APR_BUCKET_INSERT_AFTER + mpxs_APR__Bucket_remove #APR_BUCKET_REMOVE + #apr_bucket_read + mpxs_APR__Bucket_read | | bucket, wanted=0 + #modperl_bucket_sv_create + mpxs_APR__Bucket_new | | classname, sv, offset=0, len=0 + !apr_bucket_copy_notimpl + !apr_bucket_shared_copy + !apr_bucket_eos_create + !apr_bucket_file_create + !apr_bucket_flush_create + !apr_bucket_heap_create + !apr_bucket_immortal_create + !apr_bucket_mmap_create + !apr_bucket_pipe_create + !apr_bucket_pool_create + !apr_bucket_socket_create + !apr_bucket_transient_create + !apr_bucket_destroy_notimpl + !apr_bucket_shared_destroy + !apr_bucket_eos_make + !apr_bucket_file_make + !apr_bucket_flush_make + !apr_bucket_heap_make + !apr_bucket_immortal_make + !apr_bucket_mmap_make + !apr_bucket_pipe_make + !apr_bucket_pool_make + !apr_bucket_shared_make + !apr_bucket_socket_make + !apr_bucket_transient_make + !apr_bucket_setaside_notimpl + !apr_bucket_split_notimpl + !apr_bucket_shared_split + !apr_bucket_simple_split + !apr_bucket_simple_copy MODULE=APR::Pool apr_pool_free_blocks_num_bytes 1.3 +2 -2 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- apr_structures.map2001/03/16 00:01:37 1.2 +++ apr_structures.map2001/04/18 05:10:43 1.3 @@ -6,7 +6,7 @@ #buckets -!apr_bucket_type_t +apr_bucket_type_t MODULE=APR::Bucket name - num_func - destroy @@ -16,7 +16,7 @@ - copy /apr_bucket_type_t -!apr_bucket +apr_bucket link type length 1.3 +1 -1 modperl-2.0/xs/maps/apr_types.map Index: apr_types.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_types.map,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- apr_types.map 2001/03/16 00:01:37 1.2 +++ apr_types.map 2001/04/18 05:10:43 1.3 @@ -22,7 +22,7 @@ struct apr_bucket | APR::Bucket struct apr_bucket_brigade | APR::Brigade apr_brigade_flush | UNDEFINED -apr_bucket_type_t | APR::BucketType +struct apr_bucket_type_t| APR::BucketType apr_read_type_e | UNDEFINED apr_bucket_file | UNDEFINED apr_bucket_pool | UNDEFINED
cvs commit: modperl-2.0/t/filter/TestFilter buckets.pm
dougm 01/04/17 22:11:14 Added: t/filter/TestFilter buckets.pm Log: add a test for the brigade/buckets api Revision ChangesPath 1.1 modperl-2.0/t/filter/TestFilter/buckets.pm Index: buckets.pm === package TestFilter::buckets; use strict; use warnings FATAL = 'all'; use Test; use Apache::Test (); use Apache::Filter (); use APR::Brigade (); use APR::Bucket (); sub handler { my($filter, $bb) = @_; Apache::TestToString-start; plan tests = 4; #should only have 1 bucket from the response() below for (my $bucket = $bb-first; $bucket; $bucket = $bb-next($bucket)) { ok $bucket-type-name; ok $bucket-length == 2; ok $bucket-read eq 'ok'; } my $tests = Apache::TestToString-finish; my $brigade = APR::Brigade-new($filter-f-r-pool); my $bucket = APR::Bucket-new($tests); $brigade-insert_tail($bucket); my $ok = $brigade-first-type-name =~ /mod_perl/ ? 4 : 0; $brigade-insert_tail(APR::Bucket-new("ok $ok\n")); $filter-f-next-pass_brigade($brigade); Apache::OK; } sub response { my $r = shift; $r-content_type('text/plain'); $r-puts("ok"); 0; } 1; __DATA__ SetHandler modperl PerlResponseHandler TestFilter::buckets::response
cvs commit: modperl-2.0/lib/ModPerl Code.pm
dougm 01/04/17 22:25:01 Modified:lib/ModPerl Code.pm Log: strip APR_ and AP_ prefixes from constant names Revision ChangesPath 1.58 +3 -2 modperl-2.0/lib/ModPerl/Code.pm Index: Code.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- Code.pm 2001/04/18 04:40:00 1.57 +++ Code.pm 2001/04/18 05:25:01 1.58 @@ -680,7 +680,7 @@ $file; } -my $constant_prefixes = join '|', qw{APR}; +my $constant_prefixes = join '|', qw{APR?}; sub generate_constants { my($self, $h_fh, $c_fh) = @_; @@ -789,7 +789,8 @@ push @tags, $group; my $name = join '_', 'MP_constants', $class, $group; print $c_fh "\nstatic const char *$name [] = { \n", - (map { s/^APR_//; qq( "$_",\n) } @$constants), " NULL,\n};\n"; + (map { s/^($constant_prefixes)_//o; + qq( "$_",\n) } @$constants), " NULL,\n};\n"; } my %switch;
cvs commit: modperl-2.0/lib/Apache ParseSource.pm
dougm 01/04/17 22:27:39 Modified:lib/Apache ParseSource.pm Log: pickup apache_filter and input_mode constants Revision ChangesPath 1.15 +3 -2 modperl-2.0/lib/Apache/ParseSource.pm Index: ParseSource.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ParseSource.pm2001/04/12 00:48:02 1.14 +++ ParseSource.pm2001/04/18 05:27:39 1.15 @@ -164,7 +164,7 @@ } my %enums_wanted = ( -Apache = { map { $_, 1 } qw(cmd_how) }, +Apache = { map { $_, 1 } qw(cmd_how input_mode filter_type) }, APR = { map { $_, 1 } qw(apr_shutdown_how) }, ); @@ -225,7 +225,8 @@ my($name, $e) = $self-parse_enum($fh); return unless $name; -$name =~ s/_e$//; +$name =~ s/^ap_//; +$name =~ s/_(e|t)$//; my $class; for (keys %enums_wanted) {
cvs commit: modperl-2.0/xs/tables/current/Apache ConstantsTable.pm
dougm 01/04/17 22:28:18 Modified:xs/tables/current/Apache ConstantsTable.pm Log: sync Revision ChangesPath 1.5 +53 -41modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm Index: ConstantsTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ConstantsTable.pm 2001/04/18 04:42:50 1.4 +++ ConstantsTable.pm 2001/04/18 05:28:18 1.5 @@ -2,12 +2,57 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Mon Apr 16 18:17:25 2001 +# ! Tue Apr 17 22:15:55 2001 # ! do NOT edit, any changes will be lost ! # !! $Apache::ConstantsTable = { 'Apache' = { +'options' = [ + 'OPT_NONE', + 'OPT_INDEXES', + 'OPT_INCLUDES', + 'OPT_SYM_LINKS', + 'OPT_EXECCGI', + 'OPT_UNSET', + 'OPT_INCNOEXEC', + 'OPT_SYM_OWNER', + 'OPT_MULTI', + 'OPT_ALL' +], +'satisfy' = [ + 'SATISFY_ALL', + 'SATISFY_ANY', + 'SATISFY_NOSPEC' +], +'common' = [ + 'DECLINED', + 'DONE', + 'OK', + 'NOT_FOUND', + 'FORBIDDEN', + 'AUTH_REQUIRED', + 'SERVER_ERROR' +], +'cmd_how' = [ + 'RAW_ARGS', + 'TAKE1', + 'TAKE2', + 'ITERATE', + 'ITERATE2', + 'FLAG', + 'NO_ARGS', + 'TAKE12', + 'TAKE3', + 'TAKE23', + 'TAKE123', + 'TAKE13' +], +'input_mode' = [ + 'AP_MODE_BLOCKING', + 'AP_MODE_NONBLOCKING', + 'AP_MODE_PEEK' +], 'http' = [ 'HTTP_CONTINUE', 'HTTP_SWITCHING_PROTOCOLS', @@ -57,18 +102,6 @@ 'HTTP_INSUFFICIENT_STORAGE', 'HTTP_NOT_EXTENDED' ], -'options' = [ - 'OPT_NONE', - 'OPT_INDEXES', - 'OPT_INCLUDES', - 'OPT_SYM_LINKS', - 'OPT_EXECCGI', - 'OPT_UNSET', - 'OPT_INCNOEXEC', - 'OPT_SYM_OWNER', - 'OPT_MULTI', - 'OPT_ALL' -], 'methods' = [ 'M_GET', 'M_PUT', @@ -88,20 +121,6 @@ 'M_INVALID', 'METHODS' ], -'satisfy' = [ - 'SATISFY_ALL', - 'SATISFY_ANY', - 'SATISFY_NOSPEC' -], -'common' = [ - 'DECLINED', - 'DONE', - 'OK', - 'NOT_FOUND', - 'FORBIDDEN', - 'AUTH_REQUIRED', - 'SERVER_ERROR' -], 'override' = [ 'OR_NONE', 'OR_LIMIT', @@ -114,25 +133,18 @@ 'RSRC_CONF', 'OR_ALL' ], -'cmd_how' = [ - 'RAW_ARGS', - 'TAKE1', - 'TAKE2', - 'ITERATE', - 'ITERATE2', - 'FLAG', - 'NO_ARGS', - 'TAKE12', - 'TAKE3', - 'TAKE23', - 'TAKE123', - 'TAKE13' -], 'remotehost' = [ 'REMOTE_HOST', 'REMOTE_NAME', 'REMOTE_NOLOOKUP', 'REMOTE_DOUBLE_REV' +], +'filter_type' = [ + 'AP_FTYPE_CONTENT', + 'AP_FTYPE_HTTP_HEADER', + 'AP_FTYPE_TRANSCODE', + 'AP_FTYPE_CONNECTION', + 'AP_FTYPE_NETWORK' ] }, 'APR' = {
cvs commit: modperl-2.0/xs/maps apache_structures.map modperl_functions.map
dougm 01/04/13 00:17:08 Modified:src/modules/perl modperl_types.h xs/Apache/Filter Apache__Filter.h xs/maps apache_structures.map modperl_functions.map Added: t/filter/TestFilter api.pm Log: enable Apache::Filter structure interface enable Apache::FilterRec module add Apache::OutputFilter-f method for access to Apache::Filter object add filter api test Revision ChangesPath 1.35 +0 -3 modperl-2.0/src/modules/perl/modperl_types.h Index: modperl_types.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- modperl_types.h 2001/04/09 23:57:22 1.34 +++ modperl_types.h 2001/04/13 07:17:06 1.35 @@ -185,9 +185,6 @@ apr_pool_t *pool; } modperl_filter_t; -typedef modperl_filter_t * Apache__OutputFilter; -typedef modperl_filter_t * Apache__InputFilter; - typedef struct { SV *data; modperl_handler_t *handler; 1.1 modperl-2.0/t/filter/TestFilter/api.pm Index: api.pm === package TestFilter::api; use strict; use warnings FATAL = 'all'; use Apache::Filter (); use Apache::FilterRec (); use Test; my $response_data = "blah blah blah"; sub init_test_pm { my $filter = shift; { package Apache::OutputFilter; #XXX: make part of standard api? unless (defined PRINT) { *PRINT = \print; *TIEHANDLE = sub { shift }; } } tie *STDOUT, $filter; $Test::TESTOUT = \*STDOUT; $Test::planned = 0; $Test::ntest = 1; } sub handler { my $filter = shift; $filter-read(my $buffer); #slurp everything; init_test_pm($filter); plan tests = 6; ok $buffer eq $response_data; my $f = $filter-f; ok $f-isa('Apache::Filter'); my $frec = $f-frec; ok $frec-isa('Apache::FilterRec'); ok $frec-name; my $r = $f-r; ok $r-isa('Apache::RequestRec'); ok $r-uri eq '/' . __PACKAGE__; 0; } sub response { my $r = shift; $r-content_type('text/plain'); $r-puts($response_data); Apache::OK; } 1; __DATA__ SetHandler modperl PerlResponseHandler TestFilter::api::response 1.3 +2 -0 modperl-2.0/xs/Apache/Filter/Apache__Filter.h Index: Apache__Filter.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Apache__Filter.h 2001/03/13 07:28:54 1.2 +++ Apache__Filter.h 2001/04/13 07:17:07 1.3 @@ -1,3 +1,5 @@ +#define mpxs_Apache__OutputFilter_f(filter) filter-f + #define mpxs_Apache__RequestRec_add_output_filter(r, name, ctx) \ ap_add_output_filter(name, ctx, r, NULL) 1.3 +3 -3 modperl-2.0/xs/maps/apache_structures.map Index: apache_structures.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- apache_structures.map 2001/03/25 22:32:11 1.2 +++ apache_structures.map 2001/04/13 07:17:08 1.3 @@ -160,14 +160,14 @@ errmsg /command_rec -!ap_filter_rec_t +ap_filter_rec_t name - filter_func - ftype +! ftype next /ap_filter_rec_t -!ap_filter_t +ap_filter_t frec ctx next 1.2 +1 -0 modperl-2.0/xs/maps/modperl_functions.map Index: modperl_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modperl_functions.map 2001/03/17 17:33:03 1.1 +++ modperl_functions.map 2001/04/13 07:17:08 1.2 @@ -22,3 +22,4 @@ MODULE=Apache::Filter PACKAGE=Apache::OutputFilter mpxs_Apache__OutputFilter_print | | ... mpxs_Apache__OutputFilter_read | | ... + ap_filter_t *:DEFINE_f | | modperl_filter_t *:filter
cvs commit: modperl-2.0 Makefile.PL
dougm 01/04/12 09:03:55 Modified:.Makefile.PL Log: make sure test files a cleaned Revision ChangesPath 1.33 +1 -0 modperl-2.0/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- Makefile.PL 2001/04/11 23:00:56 1.32 +++ Makefile.PL 2001/04/12 16:03:55 1.33 @@ -234,6 +234,7 @@ my $self = shift; my $string = $self-MM::clean(@_); ModPerl::MM::add_dep(\$string, clean = 'modperl_src_clean'); +ModPerl::MM::add_dep(\$string, clean = 'test_clean'); $string; }
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm
dougm 01/04/12 17:47:39 Modified:Apache-Test/lib/Apache TestConfig.pm Log: add config for perchild mpm Revision ChangesPath 1.7 +9 -0 modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm Index: TestConfig.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TestConfig.pm 2001/04/12 03:23:58 1.6 +++ TestConfig.pm 2001/04/13 00:47:38 1.7 @@ -691,6 +691,15 @@ MaxRequestsPerChild 0 /IfModule +IfModule perchild.c +NumServers 1 +StartThreads 1 +MinSpareThreads 1 +MaxSpareThreads 1 +MaxThreadsPerChild 2 +MaxRequestsPerChild 0 +/IfModule + IfModule prefork.c StartServers 1 MaxClients 1
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm
dougm 01/04/12 17:51:54 Modified:Apache-Test/lib/Apache TestConfig.pm Log: forget a few things about the old config Revision ChangesPath 1.8 +2 -0 modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm Index: TestConfig.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TestConfig.pm 2001/04/13 00:47:38 1.7 +++ TestConfig.pm 2001/04/13 00:51:54 1.8 @@ -111,6 +111,8 @@ modules = {}, inc = [], %$thaw, +mpm = "", +httpd_defines = {}, vars = $args, postamble = [], preamble = [],
cvs commit: modperl-2.0/src/modules/perl modperl_callback.c
dougm 01/04/12 18:10:21 Modified:src/modules/perl modperl_callback.c Log: log rather than trace failure to resolve handler Revision ChangesPath 1.40 +3 -2 modperl-2.0/src/modules/perl/modperl_callback.c Index: modperl_callback.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- modperl_callback.c2001/04/12 03:49:42 1.39 +++ modperl_callback.c2001/04/13 01:10:20 1.40 @@ -36,8 +36,9 @@ (unsigned long)rp); if (!modperl_mgv_resolve(aTHX_ handler, rp, handler-name)) { -MP_TRACE_h(MP_FUNC, "failed to resolve handler `%s'\n", - handler-name); +ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, + "failed to resolve handler `%s'", + handler-name); return HTTP_INTERNAL_SERVER_ERROR; } }
cvs commit: modperl-2.0/t/response/TestAPR base64.pm
dougm 01/04/12 18:11:28 Added: t/response/TestAPR base64.pm Log: add test for APR::Base64 Revision ChangesPath 1.1 modperl-2.0/t/response/TestAPR/base64.pm Index: base64.pm === package TestAPR::base64; use strict; use warnings FATAL = 'all'; use Apache::Const -compile = 'OK'; use Apache::Test; use APR::Base64 (); sub handler { my $r = shift; plan $r, tests = 2; my $encoded = APR::Base64::encode("$r"); ok $encoded; my $decoded = APR::Base64::decode($encoded); ok $decoded eq "$r"; Apache::OK; } 1;
cvs commit: modperl-2.0/t/hooks/TestHooks authz.pm
dougm 01/04/12 18:26:56 Added: t/hooks authz.t t/hooks/TestHooks authz.pm Log: add PerlAuthzHandler test Revision ChangesPath 1.1 modperl-2.0/t/hooks/authz.t Index: authz.t === use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestRequest; plan tests = 4, \have_lwp; my $location = "/TestHooks::authz"; ok ! GET_OK $location; my $rc = GET_RC $location; ok $rc == 401; ok GET_OK $location, username = 'dougm', password = 'foo'; ok ! GET_OK $location, username = 'jobbob', password = 'whatever'; 1.1 modperl-2.0/t/hooks/TestHooks/authz.pm Index: authz.pm === package TestHooks::authz; use strict; use warnings FATAL = 'all'; use Apache::Access (); use Apache::Const -compile = qw(OK AUTH_REQUIRED); sub auth_any { my $r = shift; my($res, $sent_pw) = $r-get_basic_auth_pw; return $res if $res != Apache::OK; unless($r-user and $sent_pw) { $r-note_basic_auth_failure; return Apache::AUTH_REQUIRED; } return Apache::OK; } sub handler { my $r = shift; my $user = $r-user; return Apache::AUTH_REQUIRED unless $user; my($u, @allowed) = split /\s+/, $r-requires-[0]-{requirement}; return Apache::AUTH_REQUIRED unless grep { $_ eq $user } @allowed; Apache::OK; } 1; __DATA__ require user dougm AuthType Basic AuthName simple PerlAuthenHandler TestHooks::authz::auth_any PerlResponseHandler Apache::TestHandler::ok1 SetHandler modperl
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm
dougm 01/04/12 18:38:38 Modified:Apache-Test/lib/Apache TestConfigPerl.pm Log: add a few to the hook config mapping table Revision ChangesPath 1.6 +1 -1 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm Index: TestConfigPerl.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TestConfigPerl.pm 2001/04/04 17:42:11 1.5 +++ TestConfigPerl.pm 2001/04/13 01:38:38 1.6 @@ -210,7 +210,7 @@ #@INC is auto-modified so each test .pm can be found #modules can add their own configuration using __DATA__ -my %hooks = map { $_, ucfirst $_ } qw(authen); +my %hooks = map { $_, ucfirst $_ } qw(access authen authz type fixup log); $hooks{Protocol} = 'ProcessConnection'; $hooks{Filter} = 'OutputFilter';
cvs commit: modperl-2.0/t/hooks/TestHooks fixup.pm
dougm 01/04/12 18:41:54 Added: t/hooks/TestHooks fixup.pm Log: add a test for PerlFixupHandler Revision ChangesPath 1.1 modperl-2.0/t/hooks/TestHooks/fixup.pm Index: fixup.pm === package TestHooks::fixup; use strict; use warnings FATAL = 'all'; use Apache::Test; sub handler { my $r = shift; $r-notes-set(ok = 1); Apache::OK; } sub response { my $r = shift; plan $r, tests = 1; ok $r-notes-get('ok'); Apache::OK; } 1; __DATA__ PerlResponseHandler TestHooks::fixup::response SetHandler modperl
cvs commit: modperl-2.0/t/conf modperl_extra.pl
dougm 01/04/12 18:49:58 Modified:t/conf modperl_extra.pl Log: compile common constants at startup so we dont need to in each test module Revision ChangesPath 1.2 +2 -0 modperl-2.0/t/conf/modperl_extra.pl Index: modperl_extra.pl === RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modperl_extra.pl 2001/04/02 09:10:18 1.1 +++ modperl_extra.pl 2001/04/13 01:49:58 1.2 @@ -4,4 +4,6 @@ use Apache::Server (); use Apache::Connection (); +use Apache::Const -compile = ':common'; + 1;
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm
dougm 01/04/12 19:04:52 Modified:Apache-Test/lib/Apache TestConfigPerl.pm Log: allow PerlTransHandler to be properly configured Revision ChangesPath 1.7 +13 -2 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm Index: TestConfigPerl.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TestConfigPerl.pm 2001/04/13 01:38:38 1.6 +++ TestConfigPerl.pm 2001/04/13 02:04:52 1.7 @@ -164,6 +164,7 @@ my %outside_container = map { $_, 1 } qw{ Alias AliasMatch AddType +PerlChildInitHandler PerlTransHandler PerlPostReadRequestHandler }; #test .pm's can have configuration after the __DATA__ token @@ -210,7 +211,8 @@ #@INC is auto-modified so each test .pm can be found #modules can add their own configuration using __DATA__ -my %hooks = map { $_, ucfirst $_ } qw(access authen authz type fixup log); +my %hooks = map { $_, ucfirst $_ } + qw(trans access authen authz type fixup log); $hooks{Protocol} = 'ProcessConnection'; $hooks{Filter} = 'OutputFilter'; @@ -250,8 +252,17 @@ } my $container = $container_config{$hook} || \location_container; +my @handler_cfg = ($handler = $module); + +if ($outside_container{$handler}) { +$self-postamble(@handler_cfg); +} +else { +push @args, @handler_cfg; +} + $self-postamble($self-$container($module), - { $handler = $module, @args }); + { @args }) if @args; $self-write_pm_test($module, lc $base, lc $sub); }, $dir);
cvs commit: modperl-2.0/lib/ModPerl MM.pm
dougm 01/04/11 15:46:58 Modified:lib/ModPerl MM.pm Log: always link these module dynamic Revision ChangesPath 1.10 +1 -1 modperl-2.0/lib/ModPerl/MM.pm Index: MM.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- MM.pm 2001/04/10 01:57:54 1.9 +++ MM.pm 2001/04/11 22:46:57 1.10 @@ -78,7 +78,7 @@ ExtUtils::MakeMaker::WriteMakefile(@opts, @_); } -my %always_dynamic = map { $_, 1 } qw(Apache::Leak); +my %always_dynamic = map { $_, 1 } qw(ModPerl::Const Apache::Const APR::Const); sub ModPerl::MM::MY::constants { my $self = shift;
cvs commit: modperl-2.0/src/modules/perl modperl_const.c modperl_const.h
dougm 01/04/11 15:48:29 Added: src/modules/perl modperl_const.c modperl_const.h Log: module for compiling/exporting constants Revision ChangesPath 1.1 modperl-2.0/src/modules/perl/modperl_const.c Index: modperl_const.c === #include "mod_perl.h" #include "modperl_const.h" typedef int (*constants_lookup)(const char *); typedef const char ** (*constants_group_lookup)(const char *); static int new_constsub(pTHX_ constants_lookup lookup, HV *caller_stash, HV *stash, const char *name) { int name_len = strlen(name); GV **gvp = (GV **)hv_fetch(stash, name, name_len, FALSE); int val; /* dont redefine */ if (!(gvp GvCV(*gvp))) { CV *cv; val = (*lookup)(name); #if 0 fprintf(stderr, "newCONSTSUB(%s, %s, %d)\n", HvNAME(stash), name, val); #endif cv = newCONSTSUB(stash, (char *)name, newSViv(val)); gvp = CvGV(cv); } /* export into callers namespace */ if (gvp caller_stash) { GV *alias = *(GV **)hv_fetch(caller_stash, (char *)name, name_len, TRUE); if (!isGV(alias)) { gv_init(alias, caller_stash, name, name_len, TRUE); } GvCV(alias) = GvCV(*gvp); } return val; } int modperl_const_compile(pTHX_ const char *classname, const char *arg, const char *name) { HV *stash = gv_stashpv(classname, TRUE); HV *caller_stash = Nullhv; constants_lookup lookup; constants_group_lookup group_lookup; if (strnEQ(classname, "APR", 3)) { lookup = modperl_constants_lookup_apr; group_lookup = modperl_constants_group_lookup_apr; } else { lookup = modperl_constants_lookup_apache; group_lookup = modperl_constants_group_lookup_apache; } if (*arg != '-') { /* only export into callers namespace without -compile arg */ caller_stash = gv_stashpv(arg, TRUE); } if (*name == ':') { int i; const char **group; name++; group = (*group_lookup)(name); for (i=0; group[i]; i++) { new_constsub(aTHX_ lookup, caller_stash, stash, group[i]); } } else { new_constsub(aTHX_ lookup, caller_stash, stash, name); } return 1; } XS(XS_modperl_const_compile) { I32 i; STRLEN n_a; char *stashname = HvNAME(GvSTASH(CvGV(cv))); const char *classname, *arg; dXSARGS; if (items 2) { Perl_croak(aTHX_ "Usage: %s-compile(...)"); } classname = *(stashname + 1) == 'P' ? "APR" : "Apache"; arg = SvPV(ST(1),n_a); for (i=2; iitems; i++) { (void)modperl_const_compile(aTHX_ classname, arg, SvPV(ST(i), n_a)); } XSRETURN_YES; } 1.1 modperl-2.0/src/modules/perl/modperl_const.h Index: modperl_const.h === #ifndef MODPERL_CONST_H #define MODPERL_CONST_H #include "modperl_constants.h" int modperl_const_compile(pTHX_ const char *classname, const char *arg, const char *name); XS(XS_modperl_const_compile); #endif /* MODPERL_CONST_H */
cvs commit: modperl-2.0/xs/Apache/Const - New directory
dougm 01/04/11 15:49:19 modperl-2.0/xs/Apache/Const - New directory
cvs commit: modperl-2.0/xs/Apache/Const Const.pm Const.xs Makefile.PL
dougm 01/04/11 15:50:10 Added: xs/Apache/Const Const.pm Const.xs Makefile.PL Log: module for compiling/export constants in the Apache:: namespace Revision ChangesPath 1.1 modperl-2.0/xs/Apache/Const/Const.pm Index: Const.pm === package Apache::Const; use ModPerl::Const (); use XSLoader (); our $VERSION = '0.01'; our @ISA = qw(ModPerl::Const); XSLoader::load(__PACKAGE__, $VERSION); 1; 1.1 modperl-2.0/xs/Apache/Const/Const.xs Index: Const.xs === #include "mod_perl.h" #include "modperl_const.h" MODULE = Apache::ConstPACKAGE = Apache::Const BOOT: newXS("Apache::Const::compile", XS_modperl_const_compile, file); 1.1 modperl-2.0/xs/Apache/Const/Makefile.PL Index: Makefile.PL === use lib qw(../lib); use ModPerl::MM (); ModPerl::MM::WriteMakefile( NAME = 'Apache::Const', VERSION_FROM = 'Const.pm', );
cvs commit: modperl-2.0/xs/APR/Const - New directory
dougm 01/04/11 15:50:23 modperl-2.0/xs/APR/Const - New directory
cvs commit: modperl-2.0/xs/ModPerl - New directory
dougm 01/04/11 15:51:08 modperl-2.0/xs/ModPerl - New directory
cvs commit: modperl-2.0/xs/ModPerl/Const - New directory
dougm 01/04/11 15:51:31 modperl-2.0/xs/ModPerl/Const - New directory
cvs commit: modperl-2.0/xs/ModPerl/Const Const.pm Const.xs Makefile.PL
dougm 01/04/11 15:53:14 Added: xs/ModPerl Makefile.PL xs/ModPerl/Const Const.pm Const.xs Makefile.PL Log: base module for compiling/exporting constants Revision ChangesPath 1.1 modperl-2.0/xs/ModPerl/Makefile.PL Index: Makefile.PL === use ExtUtils::MakeMaker; WriteMakefile(NAME = "ModPerl", VERSION = '0.01'); 1.1 modperl-2.0/xs/ModPerl/Const/Const.pm Index: Const.pm === package ModPerl::Const; use DynaLoader (); our $VERSION = '0.01'; our @ISA = qw(DynaLoader); #dlopen("Const.so", RTDL_GLOBAL); sub dl_load_flags { 0x01 } __PACKAGE__-bootstrap($VERSION); sub import { my $class = shift; my $arg; if ($_[0] and $_[0] =~ /^-compile/) { $arg = shift; #just compile the constants subs, export nothing } $arg ||= scalar caller; #compile and export into caller's namespace $class-compile($arg, @_ ? @_ : ':common'); } 1; 1.1 modperl-2.0/xs/ModPerl/Const/Const.xs Index: Const.xs === #include "mod_perl.h" MODULE = ModPerl::ConstPACKAGE = ModPerl::Const BOOT: file = file; /* -Wall */ 1.1 modperl-2.0/xs/ModPerl/Const/Makefile.PL Index: Makefile.PL === use lib qw(../lib); use ModPerl::MM (); use File::Basename; my $srcdir = '../../../src/modules/perl'; #link these two into Const.so so constants can be used outside of httpd my @names = map { "modperl_$_" } qw(const constants); my @obj; for (@names) { my $srcfile = join '.', "$srcdir/$_", 'c'; my $lnfile = join '.', $_, 'c'; push @obj, join '.', $_, 'o'; unlink $lnfile; symlink $srcfile, $lnfile; } ModPerl::MM::WriteMakefile( NAME = 'ModPerl::Const', VERSION_FROM = 'Const.pm', OBJECT = "Const.o @obj", );
cvs commit: modperl-2.0/t/apr - New directory
dougm 01/04/11 15:53:33 modperl-2.0/t/apr - New directory
cvs commit: modperl-2.0/t/apr constants.t
dougm 01/04/11 15:54:15 Added: t/aprconstants.t Log: test for APR::Const Revision ChangesPath 1.1 modperl-2.0/t/apr/constants.t Index: constants.t === use ExtUtils::testlib; use strict; use warnings FATAL = 'all'; use Test; use APR::Const -compile = qw(:common POLLIN); use APR::Const qw(:hook); plan tests = 4; ok ! defined POLLIN; ok APR::SUCCESS == 0; ok APR::POLLIN == 0x001; ok HOOK_LAST == 20;
cvs commit: modperl-2.0/t/apache constants.t
dougm 01/04/11 15:54:48 Added: t/apache constants.t Log: test for Apache::Const Revision ChangesPath 1.1 modperl-2.0/t/apache/constants.t Index: constants.t === use ExtUtils::testlib; use strict; use warnings FATAL = 'all'; use Test; use Apache::Const -compile = qw(DECLINED :http :common TAKE23); use Apache::Const; #defaults to :common plan tests = 10; ok AUTH_REQUIRED == 401; ok OK == 0; ok Apache::OK == 0; ok Apache::DECLINED == -1; ok Apache::HTTP_GONE == 410; ok ! defined M_GET; Apache::Const-import('M_GET'); ok defined M_GET; for (qw(BOGUS :bogus)) { eval { Apache::Const-import($_) }; ok $@; } eval { Apache::Const-import('-foobar') }; ok $@;
cvs commit: modperl-2.0/t/apache constants.t
dougm 01/04/11 16:02:59 Modified:t/apache constants.t Log: test usage Revision ChangesPath 1.2 +4 -1 modperl-2.0/t/apache/constants.t Index: constants.t === RCS file: /home/cvs/modperl-2.0/t/apache/constants.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- constants.t 2001/04/11 22:54:47 1.1 +++ constants.t 2001/04/11 23:02:57 1.2 @@ -7,7 +7,7 @@ use Apache::Const -compile = qw(DECLINED :http :common TAKE23); use Apache::Const; #defaults to :common -plan tests = 10; +plan tests = 11; ok AUTH_REQUIRED == 401; ok OK == 0; @@ -28,3 +28,6 @@ ok $@; +eval { Apache::Const::compile() }; + +ok $@;
cvs commit: modperl-2.0/src/modules/perl modperl_const.c
dougm 01/04/11 16:11:03 Modified:src/modules/perl modperl_const.c Log: tab begone Revision ChangesPath 1.3 +1 -1 modperl-2.0/src/modules/perl/modperl_const.c Index: modperl_const.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- modperl_const.c 2001/04/11 23:02:12 1.2 +++ modperl_const.c 2001/04/11 23:11:01 1.3 @@ -94,7 +94,7 @@ dXSARGS; if (items 2) { - Perl_croak(aTHX_ "Usage: %s-compile(...)", stashname); +Perl_croak(aTHX_ "Usage: %s-compile(...)", stashname); } classname = *(stashname + 1) == 'P' ? "APR" : "Apache";
cvs commit: modperl-2.0/xs/ModPerl/Const .cvsignore
dougm 01/04/11 17:30:07 Modified:src/modules/perl .cvsignore Added: Apache-Test/t .cvsignore Apache-Test/t/conf .cvsignore t/apache .cvsignore t/apr.cvsignore xs/APR/Const .cvsignore xs/Apache .cvsignore xs/Apache/Const .cvsignore xs/ModPerl .cvsignore xs/ModPerl/Const .cvsignore Log: ignore Revision ChangesPath 1.1 modperl-2.0/Apache-Test/t/.cvsignore Index: .cvsignore === logs htdocs 1.1 modperl-2.0/Apache-Test/t/conf/.cvsignore Index: .cvsignore === mime.types extra.conf httpd.conf apache_test_config.pm 1.8 +2 -0 modperl-2.0/src/modules/perl/.cvsignore Index: .cvsignore === RCS file: /home/cvs/modperl-2.0/src/modules/perl/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- .cvsignore2001/01/07 22:40:38 1.7 +++ .cvsignore2001/04/12 00:30:06 1.8 @@ -14,3 +14,5 @@ *.so *.i TAGS +modperl_constants.h +modperl_constants.c 1.1 modperl-2.0/t/apache/.cvsignore Index: .cvsignore === conftree.t 1.1 modperl-2.0/t/apr/.cvsignore Index: .cvsignore === netlib.t lib.t uuid.t 1.1 modperl-2.0/xs/APR/Const/.cvsignore Index: .cvsignore === pm_to_blib Makefile Const.c Const.bs 1.1 modperl-2.0/xs/Apache/.cvsignore Index: .cvsignore === pm_to_blib Makefile 1.1 modperl-2.0/xs/Apache/Const/.cvsignore Index: .cvsignore === pm_to_blib Makefile Const.c Const.bs 1.1 modperl-2.0/xs/ModPerl/.cvsignore Index: .cvsignore === Makefile pm_to_blib 1.1 modperl-2.0/xs/ModPerl/Const/.cvsignore Index: .cvsignore === Makefile pm_to_blib Const.c Const.bs
cvs commit: modperl-2.0/src/modules/perl modperl_const.c
dougm 01/04/11 17:45:42 Modified:src/modules/perl modperl_const.c Log: only bleedperl newCONSTSUB returns a CV, older Perls are void Revision ChangesPath 1.4 +4 -6 modperl-2.0/src/modules/perl/modperl_const.c Index: modperl_const.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- modperl_const.c 2001/04/11 23:11:01 1.3 +++ modperl_const.c 2001/04/12 00:45:42 1.4 @@ -9,11 +9,11 @@ const char *name) { int name_len = strlen(name); -GV **gvp = (GV **)hv_fetch(stash, name, name_len, FALSE); +GV **gvp = (GV **)hv_fetch(stash, name, name_len, TRUE); int val; /* dont redefine */ -if (!(gvp GvCV(*gvp))) { +if (!isGV(*gvp) || !GvCV(*gvp)) { CV *cv; val = (*lookup)(name); @@ -23,13 +23,11 @@ HvNAME(stash), name, val); #endif -cv = newCONSTSUB(stash, (char *)name, newSViv(val)); - -gvp = CvGV(cv); +newCONSTSUB(stash, (char *)name, newSViv(val)); } /* export into callers namespace */ -if (gvp caller_stash) { +if (caller_stash) { GV *alias = *(GV **)hv_fetch(caller_stash, (char *)name, name_len, TRUE);
cvs commit: modperl-2.0/lib/Apache ParseSource.pm
dougm 01/04/11 17:48:02 Modified:lib/Apache ParseSource.pm Log: filter some junk out Revision ChangesPath 1.14 +2 -1 modperl-2.0/lib/Apache/ParseSource.pm Index: ParseSource.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ParseSource.pm2001/04/11 22:38:17 1.13 +++ ParseSource.pm2001/04/12 00:48:02 1.14 @@ -169,7 +169,7 @@ ); my $defines_unwanted = join '|', qw{ -HTTP_VERSION +HTTP_VERSION APR_EOL_STR }; sub get_constants { @@ -183,6 +183,7 @@ while ($fh) { if (s/^\#define\s+(\w+)\s+.*/$1/) { chomp; +next if /_H$/; next if $seen{$_}++; $self-handle_constant(\%constants); }
cvs commit: modperl-2.0/xs/tables/current/Apache ConstantsTable.pm
dougm 01/04/11 17:48:30 Modified:xs/tables/current/Apache ConstantsTable.pm Log: sync Revision ChangesPath 1.2 +2 -5 modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm Index: ConstantsTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ConstantsTable.pm 2001/04/11 22:39:49 1.1 +++ ConstantsTable.pm 2001/04/12 00:48:30 1.2 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Wed Apr 11 15:21:18 2001 +# ! Wed Apr 11 17:44:45 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -208,7 +208,6 @@ 'APR_DELONCLOSE' ], 'error' = [ - 'APR_ERRNO_H', 'APR_ENOSTAT', 'APR_ENOPOOL', 'APR_ENOFILE', @@ -231,7 +230,6 @@ 'APR_ERELATIVE', 'APR_EINCOMPLETE', 'APR_EABOVEROOT', - 'APR_EBADPATH', 'APR_EOF', 'APR_EINIT', 'APR_ENOTIMPL', @@ -258,8 +256,7 @@ 'APR_ETIMEDOUT', 'APR_EHOSTUNREACH', 'APR_ENETUNREACH', - 'APR_END', - 'APR_EOL_STR' + 'APR_END' ], 'finfo' = [ 'APR_FINFO_LINK',
cvs commit: modperl-2.0/src/modules/perl modperl_const.c
dougm 01/04/11 17:58:00 Modified:src/modules/perl modperl_const.c Log: unused variable Revision ChangesPath 1.5 +0 -2 modperl-2.0/src/modules/perl/modperl_const.c Index: modperl_const.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- modperl_const.c 2001/04/12 00:45:42 1.4 +++ modperl_const.c 2001/04/12 00:58:00 1.5 @@ -14,8 +14,6 @@ /* dont redefine */ if (!isGV(*gvp) || !GvCV(*gvp)) { -CV *cv; - val = (*lookup)(name); #if 0
cvs commit: modperl-2.0/xs/tables/current/Apache ConstantsTable.pm
dougm 01/04/11 17:59:21 Modified:xs/tables/current/Apache ConstantsTable.pm Log: re-sync Revision ChangesPath 1.3 +3 -2 modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm Index: ConstantsTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ConstantsTable.pm 2001/04/12 00:48:30 1.2 +++ ConstantsTable.pm 2001/04/12 00:59:21 1.3 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by Apache::ParseSource/0.02 -# ! Wed Apr 11 17:44:45 2001 +# ! Wed Apr 11 17:57:08 2001 # ! do NOT edit, any changes will be lost ! # !! @@ -161,7 +161,7 @@ 'APR_FILEPATH_SECUREROOT', 'APR_FILEPATH_NOTRELATIVE', 'APR_FILEPATH_NOTABSOLUTE', - 'APR_FILEPATH_CANONICAL', + 'APR_FILEPATH_NATIVE', 'APR_FILEPATH_TRUENAME' ], 'hook' = [ @@ -230,6 +230,7 @@ 'APR_ERELATIVE', 'APR_EINCOMPLETE', 'APR_EABOVEROOT', + 'APR_EBADPATH', 'APR_EOF', 'APR_EINIT', 'APR_ENOTIMPL',
cvs commit: modperl-2.0/src/modules/perl mod_perl.c
dougm 01/04/11 18:03:14 Modified:src/modules/perl mod_perl.c Log: i swear eric did this already Revision ChangesPath 1.45 +1 -1 modperl-2.0/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- mod_perl.c2001/04/10 13:55:51 1.44 +++ mod_perl.c2001/04/12 01:03:14 1.45 @@ -14,7 +14,7 @@ perl_destruct(perl); perl_free(perl); -if (handles = modperl_xs_dl_handles_get(cdata-pool)) { +if ((handles = modperl_xs_dl_handles_get(cdata-pool))) { modperl_xs_dl_handles_close(handles); }
cvs commit: modperl-2.0/src/modules/perl modperl_const.c
dougm 01/04/11 20:01:40 Modified:t/apache constants.t src/modules/perl modperl_const.c Log: allow name for imports Revision ChangesPath 1.3 +3 -2 modperl-2.0/t/apache/constants.t Index: constants.t === RCS file: /home/cvs/modperl-2.0/t/apache/constants.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- constants.t 2001/04/11 23:02:57 1.2 +++ constants.t 2001/04/12 03:01:38 1.3 @@ -4,16 +4,17 @@ use Test; -use Apache::Const -compile = qw(DECLINED :http :common TAKE23); +use Apache::Const -compile = qw(DECLINED :http :common TAKE23 OPT_EXECCGI); use Apache::Const; #defaults to :common -plan tests = 11; +plan tests = 12; ok AUTH_REQUIRED == 401; ok OK == 0; ok Apache::OK == 0; ok Apache::DECLINED == -1; ok Apache::HTTP_GONE == 410; +ok Apache::OPT_EXECCGI; ok ! defined M_GET; Apache::Const-import('M_GET'); 1.6 +3 -0 modperl-2.0/src/modules/perl/modperl_const.c Index: modperl_const.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- modperl_const.c 2001/04/12 00:58:00 1.5 +++ modperl_const.c 2001/04/12 03:01:39 1.6 @@ -75,6 +75,9 @@ } } else { +if (*name == '') { +name++; +} new_constsub(aTHX_ lookup, caller_stash, stash, name); }
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestServer.pm
dougm 01/04/10 09:48:50 Modified:Apache-Test/lib/Apache TestServer.pm Log: include -d ServerRoot in the args to start test httpd Revision ChangesPath 1.4 +2 -1 modperl-2.0/Apache-Test/lib/Apache/TestServer.pm Index: TestServer.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestServer.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TestServer.pm 2001/04/03 17:17:10 1.3 +++ TestServer.pm 2001/04/10 16:48:49 1.4 @@ -57,7 +57,8 @@ sub args { my $self = shift; -"-f $self-{config}-{vars}-{t_conf_file}"; +my $vars = $self-{config}-{vars}; +"-d $vars-{serverroot} -f $vars-{t_conf_file}"; } my %one_process = (1 = '-X', 2 = '-DONE_PROCESS');
cvs commit: modperl-2.0/t/response/TestApache conftree.pm
dougm 01/04/03 10:01:48 Added: t/response/TestApache conftree.pm Log: add some tests for ap_conftree Revision ChangesPath 1.1 modperl-2.0/t/response/TestApache/conftree.pm Index: conftree.pm === package TestApache::conftree; use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestConfig (); use Apache::Directive (); sub handler { my $r = shift; my $cfg = Apache::TestConfig-thaw; plan $r, tests = 7; ok $cfg; my $vars = $cfg-{vars}; ok $vars; my $tree = Apache::Directive-conftree; ok $tree; my $port = find_config_val($tree, 'Listen'); ok $port; ok $port == $vars-{port}; my $serverroot = find_config_val($tree, 'ServerRoot'); ok $serverroot; ok $serverroot eq qq("$vars-{serverroot}"); 0; } sub find_config_val { my($tree, $directive) = @_; while ($tree) { if ($directive eq $tree-directive) { return $tree-args; } if (my $kid = $tree-first_child) { $tree = $kid; } elsif (my $next = $tree-next) { $tree = $next; } else { if (my $parent = $tree-parent) { $tree = $parent-next; } else { $tree = undef; } } } } 1;
cvs commit: modperl-2.0/lib/Apache Build.pm
dougm 01/04/03 22:27:59 Modified:.Makefile.PL lib/Apache Build.pm Log: do a better job of finding ap_release.h to parse the server version and give more diagnostics if it fails Revision ChangesPath 1.31 +6 -0 modperl-2.0/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Makefile.PL 2001/04/02 09:17:40 1.30 +++ Makefile.PL 2001/04/04 05:27:59 1.31 @@ -52,6 +52,12 @@ } my $httpd_version = $build-httpd_version; +unless ($httpd_version) { +$build-phat_warn(EOF); +Unable to determine server version, attempting to continue.. +EOF +$httpd_version = 'unknown'; +} printf "Configuring Apache/%s mod_perl/%s Perl/v%vd\n", $httpd_version, $VERSION, $^V; 1.40 +11 -9 modperl-2.0/lib/Apache/Build.pm Index: Build.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- Build.pm 2001/04/02 07:37:36 1.39 +++ Build.pm 2001/04/04 05:27:59 1.40 @@ -418,11 +418,13 @@ } } -unless ($dir and -d $dir) { -for (@INC) { -last if -d ($dir = "$_/auto/Apache/include"); -} -} +# we not longer install Apache headers, so dont bother looking in @INC +# might end up finding 1.x headers anyhow +#unless ($dir and -d $dir) { +#for (@INC) { +#last if -d ($dir = "$_/auto/Apache/include"); +#} +#} return $self-{dir} = $dir; } @@ -450,16 +452,16 @@ sub ap_includedir { my($self, $d) = @_; -$d ||= $self-dir; - return $self-{ap_includedir} if $self-{ap_includedir} and -d $self-{ap_includedir}; + +$d ||= $self-apxs('-q' = 'INCLUDEDIR') || $self-dir; -if (-e "$d/include/httpd.h") { +if (-e "$d/include/ap_release.h") { return $self-{ap_includedir} = "$d/include"; } -$self-{ap_includedir} = $self-apxs('-q' = 'INCLUDEDIR'); +$self-{ap_includedir} = $d; } #--- parsing apache *.h files ---
cvs commit: modperl-2.0/pod modperl_dev.pod
dougm 01/04/03 22:41:07 Modified:lib/ModPerl BuildOptions.pm MM.pm pod modperl_dev.pod Log: build extensions dynamic by default Revision ChangesPath 1.7 +1 -1 modperl-2.0/lib/ModPerl/BuildOptions.pm Index: BuildOptions.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BuildOptions.pm 2001/03/26 16:17:06 1.6 +++ BuildOptions.pm 2001/04/04 05:41:06 1.7 @@ -143,7 +143,7 @@ INST_APACHE2 Install *.pm relative to Apache2/ directory PROMPT_DEFAULT Accept default value for all would-be prompts OPTIONS_FILE Read options from given file -DYNAMIC Build Apache::*.xs as dynamic extensions +STATIC_EXTS Build Apache::*.xs as static extensions APXSPath to apxs XS_GLUE_DIR Directories containing extension glue INCLUDE_DIR Add directories to search for header files 1.8 +1 -1 modperl-2.0/lib/ModPerl/MM.pm Index: MM.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- MM.pm 2001/03/04 18:43:09 1.7 +++ MM.pm 2001/04/04 05:41:06 1.8 @@ -98,7 +98,7 @@ #they are, unlike 1.xx where *.xs live in src/modules/perl #and are copied to subdir/ if DYNAMIC=1 -unless ($build-{MP_DYNAMIC}) { +if ($build-{MP_STATIC_EXTS}) { #skip .xs - .so if we are linking static my $name = $self-{NAME}; unless ($always_dynamic{$name}) { 1.12 +2 -2 modperl-2.0/pod/modperl_dev.pod Index: modperl_dev.pod === RCS file: /home/cvs/modperl-2.0/pod/modperl_dev.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- modperl_dev.pod 2001/04/04 04:11:44 1.11 +++ modperl_dev.pod 2001/04/04 05:41:07 1.12 @@ -55,9 +55,9 @@ Build mod_perl as a DSO -=item MP_DYNAMIC +=item MP_STATIC_EXTS -Build Apache::*.xs as dynamic extensions +Build Apache::*.xs as static extensions =item MP_USE_GTOP
cvs commit: modperl-2.0/Apache-Test/lib/Apache - New directory
dougm 01/04/02 01:49:36 modperl-2.0/Apache-Test/lib/Apache - New directory
cvs commit: modperl-2.0/Apache-Test/t - New directory
dougm 01/04/02 01:51:22 modperl-2.0/Apache-Test/t - New directory
cvs commit: modperl-2.0/Apache-Test/lib/Apache Test.pm
dougm 01/04/02 01:53:06 Added: Apache-Test/lib/Apache Test.pm Log: Test.pm wrapper to run under mod_perl Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/Test.pm Index: Test.pm === package Apache::Test; use strict; use warnings FATAL = 'all'; use Test qw(ok); use Exporter (); our @ISA = qw(Exporter); our @EXPORT = qw(ok plan); our $VERSION = '0.01'; #so Perl's Test.pm can be run inside mod_perl sub init_test_pm { my $r = shift; if (defined Apache::RequestRec::puts) { package Apache::RequestRec; unless (defined PRINT) { *PRINT = \puts; } tie *STDOUT, __PACKAGE__, $r; } else { $r-send_http_header; #1.xx } $r-content_type('text/plain'); $Test::TESTOUT = \*STDOUT; $Test::planned = 0; $Test::ntest = 1; } sub plan { init_test_pm(shift) if ref $_[0]; my $condition = pop @_ if ref $_[-1]; if ($condition and ! $condition-()) { print "0..1\n"; exit; #XXX: Apache-exit } Test::plan(@_); } 1;
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestRequest.pm
dougm 01/04/02 01:55:43 Added: Apache-Test/lib/Apache TestRequest.pm Log: lwp wrappers / fallback for no lwp Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/TestRequest.pm Index: TestRequest.pm === package Apache::TestRequest; use strict; use warnings FATAL = 'all'; use Apache::TestConfig (); my $have_lwp = eval { require LWP::UserAgent; require HTTP::Request::Common; }; sub has_lwp { $have_lwp } require Exporter; *import = \Exporter::import; our @EXPORT = @HTTP::Request::Common::EXPORT; our @ISA = qw(LWP::UserAgent); my $UA; my $Config; sub resolve_url { my $url = shift; return $url if $url =~ m,^(\w+):/,; $url = "/$url" unless $url =~ m,^/,; return "http://$Config-{hostport}$url"; } my %wanted_args = map {$_, 1} qw(username password realm content); sub wanted_args { \%wanted_args; } sub filter_args { my $args = shift; my(@pass, %keep); my @filter = @$args; if (ref($filter[0])) { push @pass, shift @filter; } while (my($key, $val) = splice @filter, 0, 2) { if ($wanted_args{$key}) { $keep{$key} = $val; } else { push @pass, $key, $val; } } return (\@pass, \%keep); } my %credentials; sub get_basic_credentials { my($self, $realm, $uri, $proxy) = @_; for ($realm, '__ALL__') { next unless $credentials{$_}; return @{ $credentials{$_} }; } return (undef,undef); } sub test_config { $Config ||= Apache::TestConfig-thaw; } sub vhost_socket { my $module = shift; my $hostport = test_config()-{vhosts}-{$module}-{hostport}; require IO::Socket; IO::Socket::INET-new($hostport); } sub prepare { eval { $UA ||= __PACKAGE__-new; }; $Config ||= test_config(); my $url = resolve_url(shift); my($pass, $keep) = filter_args(\@_); %credentials = (); if ($keep-{username}) { $credentials{$keep-{realm} || '__ALL__'} = [$keep-{username}, $keep-{password}]; } if (my $content = $keep-{content}) { if ($content eq '-') { $content = join '', STDIN; } push @$pass, content = $content; } return ($url, $pass, $keep); } my %shortcuts = (RC = sub { shift-code }, OK = sub { shift-is_success }, STR = sub { shift-as_string }, BODY = sub { shift-content }); for my $name (@EXPORT) { my $method = \{"HTTP::Request::Common::$name"}; no strict 'refs'; *$name = sub { my($url, $pass, $keep) = prepare(@_); return $UA-request($method-($url, @$pass)); }; while (my($shortcut, $cv) = each %shortcuts) { my $alias = join '_', $name, $shortcut; *$alias = sub { (\{$name})-(@_)-$cv; }; } } my @export_std = @EXPORT; for my $method (@export_std) { push @EXPORT, map { join '_', $method, $_ } keys %shortcuts; } #this is intended to be a fallback if LWP is not installed #so at least some tests can be run, it is not meant to be robust for my $name (qw(GET HEAD)) { next if defined $name; no strict 'refs'; *$name = sub { return test_config()-http_raw_get(shift, $name); }; } sub http_raw_get { my($hostport, $url, $want_headers) = @_; $url ||= "/"; require IO::Socket; my $s = IO::Socket::INET-new($hostport); unless ($s) { warn "cannot connect to $hostport $!"; return undef; } print $s "GET $url HTTP/1.0\n\n"; my($response_line, $header_term, $headers); $headers = ""; while ($s) { $headers .= $_; if(m:^(HTTP/\d+\.\d+)[ \t]+(\d+)[ \t]*([^\012]*):i) { $response_line = 1; } elsif(/^([a-zA-Z0-9_\-]+)\s*:\s*(.*)/) { } elsif(/^\015?\012$/) { $header_term = 1; last; } } unless ($response_line and $header_term) { warn "malformed response"; } my @body = $s; close $s; if ($want_headers) { if ($want_headers 1) { @body = (); #HEAD } unshift @body, $headers; } return wantarray ? @body : join '', @body; } sub to_string { my $obj = shift; ref($obj) ? $obj-as_string : $obj; } 1;
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm
dougm 01/04/02 01:57:34 Added: Apache-Test/lib/Apache TestConfigPerl.pm Log: test config stuff specific to modperl Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm Index: TestConfigPerl.pm === package Apache::TestConfig; #not TestConfigPerl on purpose #things specific to mod_perl use strict; use warnings FATAL = 'all'; use File::Spec::Functions qw(catfile splitdir abs2rel); use File::Find qw(finddepth); my %libmodperl = (1 = 'libperl.so', 2 = 'libmodperl.so'); sub configure_libmodperl { my $self = shift; my $server = $self-{server}; my $libname = $server-version_of(\%libmodperl); if ($server-{rev} = 2) { if (my $build_config = $self-build_config()) { $libname = $build_config-{MODPERL_LIB_SHARED} } } my $vars = $self-{vars}; $vars-{libmodperl} ||= $self-find_apache_module($libname); my $cfg; if (-e $vars-{libmodperl}) { $cfg = {LoadModule = qq(perl_module "$vars-{libmodperl}")}; } else { my $msg = "unable to locate $libname\n"; $cfg = "#$msg"; $self-trace($msg); } $self-preamble(IfModule = '!mod_perl.c', $cfg); } sub configure_inc { my $self = shift; my $top = $self-{vars}-{top_dir}; my $inc = $self-{inc}; my @trys = (catfile($top, 'lib'), catfile($top, qw(blib lib)), catfile($top, qw(blib arch))); for (@trys) { push @$inc, $_ if -d $_; } } sub write_pm_test { my($self, $pm, $base, $sub) = @_; my $dir = catfile $self-{vars}-{t_dir}, $base; my $t = catfile $dir, "$sub.t"; return if -e $t; $self-gendir($dir); my $fh = $self-genfile($t); print $fh EOF; use Apache::TestConfig (); print Apache::TestConfig-thaw-http_raw_get("/$pm"); EOF close $fh or die "close $t: $!"; } my %startup_pl = (1 = 'PerlRequire', 2 = 'PerlSwitches'); sub startup_pl_code { return 'EOF'; BEGIN { for my $file (qw(modperl_inc.pl modperl_extra.pl)) { eval { require "conf/$file" }; } } 1; EOF } sub configure_startup_pl { my $self = shift; #for 2.0 we could just use PerlSwitches -Mlib=... #but this will work for both 2.0 and 1.xx if (my $inc = $self-{inc}) { my $include_pl = catfile $self-{vars}-{t_conf}, 'modperl_inc.pl'; my $fh = $self-genfile($include_pl); for (@$inc) { print $fh "use lib '$_';\n"; } print $fh "1;\n"; } if ($self-server-{rev} = 2) { $self-postamble(PerlSwitches = "-Mlib=$self-{vars}-{serverroot}"); } my $startup_pl = catfile $self-{vars}-{t_conf}, 'modperl_startup.pl'; unless (-e $startup_pl) { my $fh = $self-genfile($startup_pl); print $fh $self-startup_pl_code; close $fh; } my $directive = $self-server-version_of(\%startup_pl); $self-postamble($directive = $startup_pl); } my %sethandler_modperl = (1 = 'perl-script', 2 = 'modperl'); my %add_hook_config = ( Response = sub { my($self, $module, $args) = @_; push @$args, SetHandler = $self-server-version_of(\%sethandler_modperl) }, ProcessConnection = sub { my($self, $module, $args) = @_; my $port = $self-new_vhost($module); $self-postamble(Listen = $port); }, ); my %container_config = ( ProcessConnection = \vhost_container, ); sub location_container { my($self, $module) = @_; Location = "/$module"; } sub vhost_container { my($self, $module) = @_; my $port = $self-{vhosts}-{$module}-{port}; VirtualHost = "_default_:$port"; } sub new_vhost { my($self, $module) = @_; my $port = $self-server-select_port; my $servername = $self-{vars}-{servername}; my $vhost = $self-{vhosts}-{$module} = {}; $vhost-{port} = $port; $vhost-{servername} = $servername; $vhost-{name} = join ':', $servername, $port; $vhost-{hostport} = $self-hostport($vhost); $port; } #test .pm's can have configuration after the __DATA__ token sub add_module_config { my($self, $module, $args) = @_; open(my $fh, $module) or return; while ($fh) { last if /^__DATA__/; } while ($fh) { next unless /\S+/; push @$args, split /\s+/, $_, 2; } } #the idea
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfig.pm
dougm 01/04/02 01:58:08 Added: Apache-Test/lib/Apache TestConfig.pm Log: base test config generator Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/TestConfig.pm Index: TestConfig.pm === package Apache::TestConfig; use strict; use warnings FATAL = 'all'; use constant WIN32 = $^O eq 'MSWin32'; use File::Spec::Functions qw(catfile abs2rel splitdir); use Cwd qw(fastcwd); use Apache::TestConfigPerl (); use Apache::TestConfigParse (); use Apache::TestServer (); my %usage = ( top_dir = 'top-level directory (default is $PWD)', t_dir = 'the t/ test directory (default is $top_dir/t)', t_conf= 'the conf/ test directory (default is $t_dir/conf)', t_logs= 'the logs/ test directory (default is $t_dir/logs)', t_conf_file = 'test httpd.conf file (default is $t_conf/httpd.conf)', src_dir = 'source directory to look for mod_foos.so', serverroot= 'ServerRoot (default is $t_dir)', documentroot = 'DocumentRoot (default is $ServerRoot/htdocs', port = 'Port (default is 8529)', servername= 'ServerName (default is localhost)', user = 'User to run test server as (default is $USER)', group = 'Group to run test server as (default is $GROUP)', bindir= 'Apache bin/ dir (default is apxs -q SBINDIR)', httpd = 'server to use for testing (default is $bindir/httpd)', target= 'name of server binary (default is apxs -q TARGET)', apxs = 'location of apxs (default is from Apache::BuildConfig)', httpd_conf= 'inherit config from this file (default is apxs derived)', ); sub usage { for my $hash (\%usage) { while (my($key, $val) = each %$hash) { printf " %-16s %s\n", $key, $val; } } } my %passenv = map { $_,1 } qw{ APXS APACHE APACHE_GROUP APACHE_USER APACHE_PORT }; sub passenv { \%passenv; } sub server { shift-{server} } sub build_config { eval { require Apache::BuildConfig; } or return undef; return Apache::Build-build_config; } sub new_test_server { my($self, $args) = @_; Apache::TestServer-new($args || $self) } sub new { my($class, $args) = @_; $args = ($args and ref($args)) ? {%$args} : {@_}; #copy my $thaw = {}; #thaw current config for (qw(conf t/conf)) { last if eval { require "$_/apache_test_config.pm"; $thaw = 'apache_test_config'-new; delete $thaw-{save}; }; }; if ($args-{thaw}) { #dont generate any new config $thaw-{$_} = $args-{$_} for keys %$args; $thaw-{server} = $thaw-new_test_server; return $thaw; } #regenerating config, so forget old if ($args-{save}) { for (qw(vhosts inherit_config modules inc)) { delete $thaw-{$_} if exists $thaw-{$_}; } } my $self = bless { clean = {}, vhosts = {}, inherit_config = {}, modules = {}, inc = [], %$thaw, vars = $args, postamble = [], preamble = [], postamble_hooks = [], preamble_hooks = [], }, $class; my $vars = $self-{vars}; #things that can be overridden for (qw(save verbose)) { next unless exists $args-{$_}; $self-{$_} = delete $args-{$_}; } $vars-{top_dir} ||= fastcwd; $vars-{top_dir} = pop_dir($vars-{top_dir}, 't'); $self-add_inc; #help to find libmodperl.so my $src_dir = catfile $vars-{top_dir}, qw(src modules perl); $vars-{src_dir} ||= $src_dir if -d $src_dir; $vars-{t_dir}||= catfile $vars-{top_dir}, 't'; $vars-{serverroot} ||= $vars-{t_dir}; $vars-{documentroot} ||= catfile $vars-{serverroot}, 'htdocs'; $vars-{t_conf} ||= catfile $vars-{serverroot}, 'conf'; $vars-{t_logs} ||= catfile $vars-{serverroot}, 'logs'; $vars-{t_conf_file} ||= catfile $vars-{t_conf}, 'httpd.conf'; $vars-{port} ||= $self-default_port; $vars-{servername} ||= $self-default_servername; $vars-{user} ||= $self-default_user; $vars-{group}||= $self-default_group; $vars-{serveradmin} ||= join '@', $vars-{user}, $vars-{servername}; $self-configure_apxs; $self-configure_httpd; $self-inherit_config; #see TestConfigParse.pm $self-{hostport} = $self-hostport; $self-{server} = $self-new_test_server; $self; } sub configure_apxs { my $self = shift; return unless $self-{MP_APXS} = $self-default_
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestServer.pm
dougm 01/04/02 01:58:38 Added: Apache-Test/lib/Apache TestServer.pm Log: methods to configure/control test server Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/TestServer.pm Index: TestServer.pm === package Apache::TestServer; use strict; use warnings FATAL = 'all'; use Socket (); use File::Spec::Functions qw(catfile); use Apache::TestConfig (); sub trace { shift-{config}-trace(@_); } sub new { my $class = shift; my $config = shift; my $self = bless { config = $config || Apache::TestConfig-thaw, }, $class; $self-{name} = join ':', map { $self-{config}-{vars}-{$_} } qw(servername port); $self-{port_counter} = $self-{config}-{vars}-{port}; $self-{version} = $self-{config}-httpd_version || ''; ($self-{rev}) = $self-{version} =~ m:^Apache/(\d)\.:; $self-{rev} ||= 2; $self; } sub version_of { my($self, $thing) = @_; $thing-{$self-{rev}}; } sub clean { my $self = shift; my $dir = $self-{config}-{vars}-{t_logs}; for (qw(error_log access_log httpd.pid)) { my $file = catfile $dir, $_; if (unlink $file) { $self-trace("unlink $file"); } } } sub pid_file { my $self = shift; catfile $self-{config}-{vars}-{t_logs}, 'httpd.pid'; } sub args { my $self = shift; "-f $self-{config}-{vars}-{t_conf_file}"; } my %one_process = (1 = '-X', 2 = '-DONE_PROCESS'); sub start_cmd { my $self = shift; #XXX: threaded mpm does not respond to SIGTERM with -DONE_PROCESS my $one = $self-{rev} == 1 ? '-X' : ''; my $args = $self-args; return "$self-{config}-{vars}-{httpd} $one $args"; } sub start_gdb { my $self = shift; my $config = $self-{config}; my $args = $self-args; my $one_process = $self-version_of(\%one_process); my $file = catfile $config-{vars}-{serverroot}, '.gdb-test-start'; my $fh = $config-genfile($file); print $fh "run $one_process $args"; close $fh; system "gdb $config-{vars}-{httpd} -command $file"; unlink $file; } sub start_debugger { shift-start_gdb; #XXX support dbx and others } sub pid { my $self = shift; my $file = $self-pid_file; open my $fh, $file or do { return 0; }; chomp(my $pid = $fh); $pid; } sub select_port { my $self = shift; my $max_tries = 100; #XXX while (! $self-port_available(++$self-{port_counter})) { return 0 if --$max_tries = 0; } return $self-{port_counter}; } sub port_available { my $self = shift; my $port = shift || $self-{config}-{vars}-{port}; local *S; my $proto = getprotobyname('tcp'); socket(S, Socket::PF_INET(), Socket::SOCK_STREAM(), $proto) || die "socket: $!"; setsockopt(S, Socket::SOL_SOCKET(), Socket::SO_REUSEADDR(), pack("l", 1)) || die "setsockopt: $!"; if (bind(S, Socket::sockaddr_in($port, Socket::INADDR_ANY( { close S; return 1; } else { return 0; } } sub stop { my $self = shift; my $aborted = shift; my $pid = 0; my $tries = 3; my $tried_kill = 0; my $port = $self-{config}-{vars}-{port}; while ($self-ping) { #my $state = $tried_kill ? "still" : "already"; #print "Port $port $state in use\n"; if ($pid = $self-pid and !$tried_kill++) { if (kill TERM = $pid) { print "server $self-{name} shutdown (pid=$pid)\n"; sleep 1; for (1..4) { if (! $self-ping) { return $pid if $_ == 1; last; } if ($_ == 1) { print "port $port still in use..."; } else { print "..."; } sleep $_; } if ($self-ping) { print "\nserver was shutdown but port $port ", "is still in use, please shutdown the service ", "using this port or select another port ", "for the tests\n"; } else { print "done\n"; } }
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestRun.pm
dougm 01/04/02 01:59:56 Added: Apache-Test/lib/Apache TestRun.pm Log: methods to drive the tests Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/TestRun.pm Index: TestRun.pm === package Apache::TestRun; use strict; use warnings FATAL = 'all'; use Apache::TestConfig (); use Apache::TestRequest (); use Apache::TestHarness (); use File::Spec::Functions qw(catfile); use Getopt::Long qw(GetOptions); my @std_run = qw(start-httpd run-tests stop-httpd); my @others = qw(verbose configure clean help ping); my @flag_opts= (@std_run, @others); my @list_opts= qw(preamble postamble); my @hash_opts= qw(header); my @exit_opts= qw(clean help ping debug); my @request_opts = qw(get head post); my %usage = ( 'start-httpd' = 'start the test server', 'run-tests' = 'run the tests', 'stop-httpd' = 'stop the test server', 'verbose' = 'verbose output', 'configure' = 'force regeneration of httpd.conf', 'clean' = 'remove all generated test files', 'help'= 'display this message', 'preamble'= 'config to add at the beginning of httpd.conf', 'postamble' = 'config to add at the end of httpd.conf', 'ping'= 'test if server is running or port in use', 'debug' = 'start server under debugger (e.g. gdb)', 'header' = "add headers to (".join('|', @request_opts).") request", (map { $_, "\U$_\E url" } @request_opts), ); sub new { my $class = shift; bless { tests = [], @_, }, $class; } #split arguments into test files/dirs and options #take extra care if -e, the file matches /\.t$/ #if -d, the dir contains .t files #so we dont slurp arguments that are not tests, example: # httpd $HOME/apache-2.0/bin/httpd sub split_args { my($self, $argv) = @_; my(@tests, @args); for (@$argv) { my $arg = $_; #need the t/ for stat-ing, but dont want to include it in test output $arg =~ s:^t/::; my $t_dir = catfile qw(.. t); my $file = catfile $t_dir, $arg; if (-d $file and $_ ne '/') { my @files = $file/*.t; if (@files) { my $remove = catfile $t_dir, ""; push @tests, map { s,^\Q$remove,,; $_ } @files; next; } } else { if ($file =~ /\.t$/ and -e $file) { push @tests, "$arg"; next; } elsif (-e "$file.t") { push @tests, "$arg.t"; next; } } push @args, $_; } #default HEAD|GET to / for (my $i = 0; $i @args; $i++) { if ($args[$i] =~ /^-(get|head)/) { unless ($args[$i+1] and $args[$i+1] =~ m:^/:) { splice @args, $i+1, 0, '/'; } last; } } $self-{tests} = \@tests; $self-{args} = \@args; } sub passenv { my $passenv = Apache::TestConfig-passenv; for (keys %$passenv) { return 1 if $ENV{$_}; } 0; } sub getopts { my($self, $argv) = @_; $self-split_args($argv); #dont count test files/dirs as @ARGV arguments local *ARGV = $self-{args}; my(%opts, %vopts, %conf_opts); GetOptions(\%opts, @flag_opts, @exit_opts, (map "$_=s", @request_opts), (map { ("$_=s", $vopts{$_} ||= []) } @list_opts), (map { ("$_=s", $vopts{$_} ||= {}) } @hash_opts)); $opts{$_} = $vopts{$_} for keys %vopts; #force regeneration of httpd.conf if commandline args want to modify it $opts{configure} ||= (grep { $opts{$_}-[0] } qw(preamble postamble)) || @ARGV || $self-passenv() || (! -e 'conf/httpd.conf'); while (my($key, $val) = splice @ARGV, 0, 2) { $conf_opts{lc $key} = $val; } if ($opts{configure}) { $conf_opts{save} = 1; } else { $conf_opts{thaw} = 1; } #propagate some values for (qw(verbose)) { $conf_opts{$_} = $opts{$_}; } $self-{opts} = \%opts; $self-{conf_opts} = \%conf_opts; } sub default_run_opts { my $self = shift; my($opts, $tests) = ($self-{opts}, $self-{tests}); unless (grep { $opts-{$_} } @std_run, @request_opts) { if (@$tests $self-{server}-ping) { #if certain tests are specified and server is running, dont restart $opts-{'run-tests'} = 1; } else {
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestHandler.pm
dougm 01/04/02 02:00:29 Added: Apache-Test/lib/Apache TestHandler.pm Log: Perl*Handler utilities Revision ChangesPath 1.1 modperl-2.0/Apache-Test/lib/Apache/TestHandler.pm Index: TestHandler.pm === package Apache::TestHandler; use Apache::Test (); #some utility handlers for testing hooks other than response #see modperl-2.0/t/hooks/TestHooks/authen.pm #compat with 1.xx my $send_http_header = Apache-can('send_http_header') || sub {}; my $print = Apache-can('print') || Apache::RequestRec-can('puts'); sub ok { my $r = shift; $r-$send_http_header; $r-content_type('text/plain'); $r-$print("ok"); 0; } sub ok1 { my $r = shift; Apache::Test::plan($r, tests = 1); Apache::Test::ok(1); 0; } 1;
cvs commit: modperl-2.0/Apache-Test/t TEST ping.t request.t
dougm 01/04/02 02:01:25 Added: Apache-Test/t TEST ping.t request.t Log: test test files Revision ChangesPath 1.1 modperl-2.0/Apache-Test/t/TEST Index: TEST === #!perl use strict; use warnings FATAL = 'all'; use lib qw(lib ../lib); use Apache::TestRun (); package MyTest; our @ISA = qw(Apache::TestRun); sub configure_modperl {} #dont configure mod_perl for these tests MyTest-new-run(@ARGV); 1.1 modperl-2.0/Apache-Test/t/ping.t Index: ping.t === use strict; use warnings FATAL = 'all'; use Apache::Test; plan tests = 3; use Apache::TestConfig (); my $test_config = Apache::TestConfig-thaw; ok $test_config; my $server = $test_config-server; ok $server; ok $server-ping; 1.1 modperl-2.0/Apache-Test/t/request.t Index: request.t === use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestRequest; plan tests = 9, \Apache::TestRequest::has_lwp; my $url = '/'; ok GET_OK $url; ok GET_RC $url; ok GET_STR $url; ok GET_BODY $url; ok HEAD_OK $url; ok HEAD_RC $url; ok HEAD_STR $url; ok GET_OK $url, username = 'dougm', password = ''; #e.g. for auth ok GET_OK $url, Referer = $0; #add headers #post a string #ok POST_OK $url, content = 'post body data'; #or key/value pairs (see HTTP::Request::Common #ok POST_OK $url, [university = 'arizona', team = 'wildcats']
cvs commit: modperl-2.0/t - New directory
dougm 01/04/02 02:03:17 modperl-2.0/t - New directory