cvs commit: modperl-2.0/xs/maps apache_types.map
stas02/03/25 17:52:12 Modified:xs/maps apache_types.map Log: add the typemap for 'double' needed by xs_generate Revision ChangesPath 1.7 +1 -0 modperl-2.0/xs/maps/apache_types.map Index: apache_types.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_types.map,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- apache_types.map 10 Sep 2001 06:42:51 - 1.6 +++ apache_types.map 26 Mar 2002 01:52:12 - 1.7 @@ -50,6 +50,7 @@ long int| IV unsigned long | UV unsigned| UV +double | NV char * | PV const char * | PV
cvs commit: modperl-2.0/ModPerl-Registry/t basic.t
stas02/04/05 10:44:39 Modified:ModPerl-Registry/t basic.t Log: - s/http_raw_get/GET_BODY/, the former doesn't exist anymore Revision ChangesPath 1.4 +5 -6 modperl-2.0/ModPerl-Registry/t/basic.t Index: basic.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- basic.t 19 Oct 2001 07:32:31 - 1.3 +++ basic.t 5 Apr 2002 18:44:39 - 1.4 @@ -3,7 +3,8 @@ use Apache::Test; use Apache::TestUtil; -use Apache::TestRequest; +use Apache::TestRequest qw(GET_BODY HEAD); + my %modules = (registry=> 'ModPerl::Registry', @@ -16,15 +17,13 @@ plan tests => @aliases * 3; -my $cfg = Apache::Test::config(); - # very basic compilation/response test for my $alias (@aliases) { my $url = "/$alias/basic.pl"; ok t_cmp( "ok", - $cfg->http_raw_get($url), + GET_BODY($url), "$modules{$alias} basic cgi test", ); } @@ -46,7 +45,7 @@ ok t_cmp( "foo=bar", - $cfg->http_raw_get($url), + GET_BODY($url), "$modules{$alias} mod_cgi-like environment pre-set", ); } @@ -59,7 +58,7 @@ #ok t_cmp( # "it works", -# $cfg->http_raw_get($url), +# GET_BODY($url), # "$modules{$alias} mod_cgi-like environment pre-set", #); #}
cvs commit: modperl-2.0/t/response/TestApache subprocess.pm
stas02/04/06 09:48:12 Modified:t/response/TestApache subprocess.pm Log: mark the sub-tests as todo only for perl < 5.7.3 Revision ChangesPath 1.5 +3 -1 modperl-2.0/t/response/TestApache/subprocess.pm Index: subprocess.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/subprocess.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- subprocess.pm 18 Dec 2001 05:54:59 - 1.4 +++ subprocess.pm 6 Apr 2002 17:48:12 - 1.5 @@ -38,7 +38,9 @@ my $vars = $cfg->{vars}; # XXX: these tests randomly fail under 5.6.1 -plan $r, todo => [1..4], tests => 4, have_module 'Apache::SubProcess'; +my @todo = $] < 5.007003 ? (todo => [1..4]) : (); + +plan $r, @todo, tests => 4, have_module 'Apache::SubProcess'; my $target_dir = catfile $vars->{documentroot}, "util";
cvs commit: modperl-2.0/lib/Apache Reload.pm
stas02/04/07 10:56:46 Modified:lib/Apache Reload.pm Log: $r->dir_config needs Apache::RequestUtil to be loaded. Revision ChangesPath 1.3 +2 -0 modperl-2.0/lib/Apache/Reload.pm Index: Reload.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Reload.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Reload.pm 4 Dec 2001 11:29:36 - 1.2 +++ Reload.pm 7 Apr 2002 17:56:46 - 1.3 @@ -5,6 +5,8 @@ our $VERSION = '0.08'; +require Apache::RequestUtil; + use vars qw(%INCS %Stat $TouchTime %UndefFields); %Stat = ($INC{"Apache/Reload.pm"} => time);
cvs commit: modperl-2.0/t/response/TestApache subprocess.pm
stas02/04/09 00:26:24 Modified:t/response/TestApache subprocess.pm Log: skip the subprocess test if perl < 5.7.3 Revision ChangesPath 1.6 +3 -3 modperl-2.0/t/response/TestApache/subprocess.pm Index: subprocess.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/subprocess.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- subprocess.pm 6 Apr 2002 17:48:12 - 1.5 +++ subprocess.pm 9 Apr 2002 07:26:24 - 1.6 @@ -38,9 +38,9 @@ my $vars = $cfg->{vars}; # XXX: these tests randomly fail under 5.6.1 -my @todo = $] < 5.007003 ? (todo => [1..4]) : (); - -plan $r, @todo, tests => 4, have_module 'Apache::SubProcess'; +plan $r, tests => 4, +have {"perl < 5.7.3" => sub { $] >= 5.007003 } }, + 'Apache::SubProcess'; my $target_dir = catfile $vars->{documentroot}, "util";
cvs commit: modperl-2.0/todo possible_new_features.txt
stas02/04/09 00:32:56 Modified:todo possible_new_features.txt Log: note that Apache::Subprocess is incomplete with 5.6.1 Revision ChangesPath 1.13 +2 -0 modperl-2.0/todo/possible_new_features.txt Index: possible_new_features.txt === RCS file: /home/cvs/modperl-2.0/todo/possible_new_features.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- possible_new_features.txt 12 Nov 2001 06:57:41 - 1.12 +++ possible_new_features.txt 9 Apr 2002 07:32:56 - 1.13 @@ -91,6 +91,8 @@ - should Apache::Registry use filename instead of vhost_name+uri? - core Apache::SubProcess w/ proper CORE::GLOBAL::{fork,exec} support + + currently works only with $] >= 5.007003 (see the +apache/subprocess test) - Apache::compat has to be loaded before CGI.pm, other than documenting this issue, it's possible that we will add:
cvs commit: modperl-2.0/t/response/TestModules cgi.pm cgiupload.pm
stas02/04/11 04:08:45 Modified:t/filter/TestFilter api.pm buckets.pm input_body.pm input_msg.pm lc.pm reverse.pm t/hooks/TestHooks access.pm authen.pm authz.pm fixup.pm headerparser.pm init.pm trans.pm t/protocol/TestProtocol echo.pm echo_filter.pm eliza.pm t/response/TestAPI access.pm aplog.pm conn_rec.pm lookup_uri.pm lookup_uri2.pm module.pm r_subclass.pm request_rec.pm response.pm rutil.pm send_fd.pm sendfile.pm server_rec.pm server_util.pm uri.pm t/response/TestAPR base64.pm date.pm netlib.pm perlio.pm pool.pm string.pm table.pm util.pm uuid.pm t/response/TestApache cgihandler.pm compat.pm compat2.pm conftree.pm post.pm read.pm scanhdrs.pm subprocess.pm write.pm t/response/TestDirective env.pm perlmodule.pm perlrequire.pm setupenv.pm t/response/TestModperl dir_config.pm endav.pm env.pm exit.pm getc.pm pnotes.pm print.pm printf.pm readline.pm sameinterp.pm t/response/TestModules cgi.pm cgiupload.pm Log: tidy up tests: - fetch/use Apache::OK instead of return 0; - use() all modules used in tests even if preloaded elsewhere - use warnings FATAL => 'all' everywhere - fix warnings exposed by enabling warnings Revision ChangesPath 1.6 +4 -0 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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- api.pm5 Dec 2001 19:57:29 - 1.5 +++ api.pm11 Apr 2002 11:08:43 - 1.6 @@ -3,10 +3,14 @@ use strict; use warnings FATAL => 'all'; +use Apache::RequestRec (); +use Apache::RequestIO (); use Apache::Filter (); use Apache::FilterRec (); use Apache::Test; + +use Apache::Const -compile => 'OK'; my $response_data = "blah blah blah"; 1.6 +6 -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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- buckets.pm29 Mar 2002 16:16:43 - 1.5 +++ buckets.pm11 Apr 2002 11:08:43 - 1.6 @@ -3,10 +3,15 @@ use strict; use warnings FATAL => 'all'; -use Test; +use Apache::Test; + +use Apache::RequestRec (); +use Apache::RequestIO (); use Apache::Filter (); use APR::Brigade (); use APR::Bucket (); + +use Apache::Const -compile => 'OK'; sub handler { my($filter, $bb) = @_; 1.11 +5 -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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- input_body.pm 29 Mar 2002 16:16:43 - 1.10 +++ input_body.pm 11 Apr 2002 11:08:43 - 1.11 @@ -5,10 +5,13 @@ use base qw(Apache::Filter); #so we inherit MODIFY_CODE_ATTRIBUTES -use Apache::Const -compile => qw(M_POST); -use APR::Const -compile => ':common'; +use Apache::RequestRec (); +use Apache::RequestIO (); use APR::Brigade (); use APR::Bucket (); + +use Apache::Const -compile => qw(OK M_POST); +use APR::Const -compile => ':common'; sub handler : FilterRequestHandler { my($filter, $bb, $mode, $block, $readbytes) = @_; 1.11 +5 -0 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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- input_msg.pm 29 Mar 2002 16:16:43 - 1.10 +++ input_msg.pm 11 Apr 2002 11:08:43 - 1.11 @@ -5,8 +5,13 @@ use base qw(Apache::Filter); +use Apache::RequestRec (); +use Apache::RequestIO (); use APR::Brigade (); use APR::Bucket (); + +use Apache::Const -compile => 'OK'; +use APR::Const -compile => ':common'; my $from_url = '/input_filter.html'; my $to_url = '/TestFilter::input_msg::response'; 1.3 +3 -1 modperl-2.0/t/filter/TestFilter/lc.pm Inde
cvs commit: modperl-2.0/ModPerl-Registry Makefile.PL
stas02/05/14 08:43:03 Modified:ModPerl-Registry Makefile.PL Log: tidy up Revision ChangesPath 1.5 +9 -7 modperl-2.0/ModPerl-Registry/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/Makefile.PL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.PL 6 Apr 2002 04:42:00 - 1.4 +++ Makefile.PL 14 May 2002 15:43:03 - 1.5 @@ -1,16 +1,18 @@ -use lib qw(../lib); -use ModPerl::MM (); +use strict; +use warnings FATAL => 'all'; +no warnings 'redefine'; + +use lib qw(../lib ../Apache-Test/lib); -use lib qw(lib ../Apache-Test/lib); +use ModPerl::MM (); # enable 'make test|clean' use Apache::TestMM qw(test clean); # prerequisites -my %require = - ( - "Apache::Test" => "", # any version will do? - ); +my %require = ( +"Apache::Test" => "", # any version will do? +); my @scripts = qw(t/TEST);
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas02/05/14 08:45:06 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: - use the missing Apache::RequestRec - no need for $r->seqno Revision ChangesPath 1.7 +4 -3 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- RegistryCooker.pm 16 Apr 2002 17:14:16 - 1.6 +++ RegistryCooker.pm 14 May 2002 15:45:06 - 1.7 @@ -17,7 +17,8 @@ use Apache::compat (); -use Apache::Response; +use Apache::Response (); +use Apache::RequestRec (); use Apache::Log; use Apache::Const -compile => qw(:common &OPT_EXECCGI); use File::Spec::Functions (); @@ -169,9 +170,9 @@ my $rc = Apache::OK; my $cv = \&{"$package\::handler"}; -{ # run the code if $r->seqno, preserve warnings setup when it's done +{ # run the code and preserve warnings setup when it's done no warnings; -eval { $rc = &{$cv}($r, @_) } if $r->seqno; +eval { $rc = &{$cv}($r, @_) }; $o->[STATUS] = $rc; ModPerl::Global::special_list_call(END => $package); }
cvs commit: modperl-2.0/ModPerl-Registry/t special_blocks.t
stas02/05/14 08:47:12 Modified:ModPerl-Registry/t/cgi-bin special_blocks.pl ModPerl-Registry/t special_blocks.t Log: - use Apache::RequestRec - move away from Apache::compat, meaning $r->args is a string Revision ChangesPath 1.3 +3 -3 modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl Index: special_blocks.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- special_blocks.pl 21 Oct 2001 06:58:24 - 1.2 +++ special_blocks.pl 14 May 2002 15:47:12 - 1.3 @@ -1,6 +1,7 @@ #!perl -w # test BEGIN/END blocks +use Apache::RequestRec (); use vars qw($query); $query = '' unless defined $query; @@ -12,8 +13,7 @@ print "Content-type: text/plain\r\n\r\n"; my $r = shift; -my %args = $r->Apache::args; -our $test = exists $args{test} ? $args{test} : ''; +our $test = $r->args || ''; if ($test eq 'uncache') { # mark the script as non-cached for the next execution @@ -21,7 +21,7 @@ ModPerl::RegistryCooker::uncache_myself(); } elsif ($test eq 'begin') { -print "begin ok" if $query eq 'test=begin'; +print "begin ok" if $query eq 'begin'; # reset the global $query = ''; } 1.3 +10 -10modperl-2.0/ModPerl-Registry/t/special_blocks.t Index: special_blocks.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/special_blocks.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- special_blocks.t 21 Oct 2001 06:53:28 - 1.2 +++ special_blocks.t 14 May 2002 15:47:12 - 1.3 @@ -27,25 +27,25 @@ ok t_cmp( "begin ok", - req($same_interp, "$url?test=begin"), + req($same_interp, "$url?begin"), "$modules{$alias} is running BEGIN blocks on the first req", ); ok t_cmp( "begin ok", - req($same_interp, "$url?test=begin"), + req($same_interp, "$url?begin"), "$modules{$alias} is running BEGIN blocks on the second req", ); ok t_cmp( "end ok", - req($same_interp, "$url?test=end"), + req($same_interp, "$url?end"), "$modules{$alias} is running END blocks on the first req", ); ok t_cmp( "end ok", - req($same_interp, "$url?test=end"), + req($same_interp, "$url?end"), "$modules{$alias} is running END blocks on the second req", ); } @@ -60,32 +60,32 @@ my $same_interp = Apache::TestRequest::same_interp_tie($url); # clear the cache of the registry package for the script in $url -req($same_interp, "$url?test=uncache"); +req($same_interp, "$url?uncache"); ok t_cmp( "begin ok", - req($same_interp, "$url?test=begin"), + req($same_interp, "$url?begin"), "$modules{$alias} is running BEGIN blocks on the first req", ); ok t_cmp( "", - req($same_interp, "$url?test=begin"), + req($same_interp, "$url?begin"), "$modules{$alias} is not running BEGIN blocks on the second req", ); # clear the cache of the registry package for the script in $url -req($same_interp, "$url?test=uncache"); +req($same_interp, "$url?uncache"); ok t_cmp( "end ok", - req($same_interp, "$url?test=end"), + req($same_interp, "$url?end"), "$modules{$alias} is running END blocks on the first req", ); ok t_cmp( "end ok", - req($same_interp, "$url?test=end"), + req($same_interp, "$url?end"), "$modules{$alias} is running END blocks on the second req", );
cvs commit: modperl-2.0/ModPerl-Registry/t TEST.PL
stas02/05/14 08:50:44 Modified:ModPerl-Registry/t TEST.PL Log: making 'make test' in sub-dirs working: - @INC adjustments - need to find the locally built mod_perl.so, to run the test Revision ChangesPath 1.4 +14 -1 modperl-2.0/ModPerl-Registry/t/TEST.PL Index: TEST.PL === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/TEST.PL,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TEST.PL 13 Nov 2001 04:35:26 - 1.3 +++ TEST.PL 14 May 2002 15:50:44 - 1.4 @@ -3,13 +3,18 @@ use strict; use warnings FATAL => 'all'; -use lib "../lib"; # test against the source lib for easier dev use lib map {("../blib/$_", "../../blib/$_")} qw(lib arch); +# test against the source lib for easier dev +use lib map {("../$_", "../../$_")} qw(lib Apache-Test/lib); use Apache::TestRunPerl (); +# sub-class Apache::TestRunPerl package MyTest; +use Cwd (); +use File::Spec::Functions qw(splitpath splitdir catpath catdir rootdir); + our @ISA = qw(Apache::TestRunPerl); # subclass new_test_config to add some config vars which will be @@ -17,7 +22,15 @@ sub new_test_config { my $self = shift; +my ($volume, $dir, $file) = splitpath Cwd::cwd(), 1; +my @dir = grep {length} splitdir $dir; +$dir = catdir @dir[0..($#dir-2)]; # remove two last dir segments +my $base = rootdir() . catpath $volume, $dir, $file; + $self->{conf_opts}->{maxclients} = 2; + + $self->{conf_opts}->{src_dir} = catdir $base, qw(src modules perl); + # $self->{conf_opts}->{libmodperl} = "$cwd/../../src/modules/perl/mod_perl.so"; return $self->SUPER::new_test_config; }
cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin require.pl
stas02/05/14 08:53:05 Modified:ModPerl-Registry/t/cgi-bin require.pl Log: this test is temporary becoming TODO, need to solve the require() relative to the script's dir problem. Revision ChangesPath 1.2 +6 -4 modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl Index: require.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- require.pl9 Oct 2001 12:47:38 - 1.1 +++ require.pl14 May 2002 15:53:05 - 1.2 @@ -2,8 +2,10 @@ print "Content-type: text/plain\r\n\r\n"; -use lib qw(.); -my $file = "./local-conf.pl"; -require $file; +# XXX: fixme! +#use lib qw(.); +#my $file = "./local-conf.pl"; +#require $file; -print defined $test_require && $test_require; +#print defined $test_require && $test_require; +print "it works";
cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in
stas02/05/14 08:55:21 Modified:ModPerl-Registry/t/conf extra.conf.in Log: - must define the @INC changes in one touch, or the order becoming reversed, and that's not what we want. - use Apache2 (to cover the case where Apache2/ prefix is needed) Revision ChangesPath 1.4 +10 -6 modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in Index: extra.conf.in === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- extra.conf.in 13 Nov 2001 04:33:06 - 1.3 +++ extra.conf.in 14 May 2002 15:55:21 - 1.4 @@ -3,14 +3,18 @@ # make sure that we test under Taint mode PerlSwitches -T +PerlModule Apache2 + +PerlSwitches -Mlib=@ServerRoot@/../lib \ + -Mlib=@ServerRoot@/../../Apache-Test/lib \ + -Mlib=@ServerRoot@/../../lib \ + -Mlib=@ServerRoot@/../../blib/lib/Apache2 \ + -Mlib=@ServerRoot@/../../blib/arch/Apache2 \ + -Mlib=@ServerRoot@/../../blib/lib \ + -Mlib=@ServerRoot@/../../blib/arch + # run on startup PerlRequire @ServerRoot@/conf/modperl_extra_startup.pl - -PerlSwitches -Mlib=@ServerRoot@/../lib -PerlSwitches -Mlib=@ServerRoot@/../../Apache-Test/lib -PerlSwitches -Mlib=@ServerRoot@/../../lib -PerlSwitches -Mlib=@ServerRoot@/../../blib/lib -PerlSwitches -Mlib=@ServerRoot@/../../blib/arch DEVMODE: Remove in production ### PerlModule Apache::Reload
cvs commit: modperl-2.0/ModPerl-Registry Makefile.PL
stas02/05/14 08:57:14 Modified:ModPerl-Registry Makefile.PL Log: adjust @INC, so we can run t/TEST and cd t && TEST Revision ChangesPath 1.6 +1 -1 modperl-2.0/ModPerl-Registry/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/Makefile.PL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Makefile.PL 14 May 2002 15:43:03 - 1.5 +++ Makefile.PL 14 May 2002 15:57:14 - 1.6 @@ -2,7 +2,7 @@ use warnings FATAL => 'all'; no warnings 'redefine'; -use lib qw(../lib ../Apache-Test/lib); +use lib map {($_, "../$_") } qw(lib Apache-Test/lib); use ModPerl::MM ();
cvs commit: modperl-2.0/ModPerl-Registry/t/conf modperl_extra_startup.pl
stas02/05/14 10:12:01 Modified:ModPerl-Registry/t/conf modperl_extra_startup.pl Log: registry loader is a bit broken, disable the loading at the startup for now Revision ChangesPath 1.2 +38 -32modperl-2.0/ModPerl-Registry/t/conf/modperl_extra_startup.pl Index: modperl_extra_startup.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/modperl_extra_startup.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modperl_extra_startup.pl 13 Nov 2001 04:33:06 - 1.1 +++ modperl_extra_startup.pl 14 May 2002 17:12:01 - 1.2 @@ -1,41 +1,47 @@ # - use strict; -use warnings; +use warnings FATAL => 'all'; + +# XXX: this should go +use Apache::compat; +use Apache::ServerUtil; +use Apache::Process; +use APR::Pool; # test the scripts pre-loading by explicitly specifying uri => filename use ModPerl::RegistryLoader (); my $rl = ModPerl::RegistryLoader->new(package => "ModPerl::Registry"); -my $base_dir = Apache::server_root_relative("cgi-bin"); + +my $pool = Apache->server->process->pool; +my $base_dir = Apache::server_root_relative($pool, "cgi-bin"); my $base_uri = "/cgi-bin"; -for my $file (qw(basic.pl env.pl)) { -my $file_path = "$base_dir/$file"; -my $info_path = "$base_uri/$file"; -$rl->handler($info_path, $file_path); -} - -{ -# test the scripts pre-loading by using trans sub -use ModPerl::RegistryLoader (); -use DirHandle (); -use strict; - -my $dir = Apache::server_root_relative("cgi-bin"); - -sub trans { -my $uri = shift; -$uri =~ s|^/registry_bb/|cgi-bin/|; -return Apache::server_root_relative($uri); -} - -my $rl = ModPerl::RegistryLoader->new(package => "ModPerl::RegistryBB", - trans => \&trans); -my $dh = DirHandle->new($dir) or die $!; - -for my $file ($dh->read) { -next unless $file =~ /\.pl$/; -$rl->handler("/registry_bb/$file"); -} -} +#for my $file (qw(basic.pl env.pl)) { +#my $file_path = "$base_dir/$file"; +#my $info_path = "$base_uri/$file"; +#$rl->handler($info_path, $file_path); +#} + +#{ +## test the scripts pre-loading by using trans sub +#use DirHandle (); +#use strict; + +#sub trans { +#my $uri = shift; +#$uri =~ s|^/registry_bb/|cgi-bin/|; +#return Apache::server_root_relative($pool, $uri); +#} + +#my $dir = Apache::server_root_relative($pool, "cgi-bin"); + +#my $rl = ModPerl::RegistryLoader->new(package => "ModPerl::RegistryBB", +# trans => \&trans); +#my $dh = DirHandle->new($dir) or die $!; + +#for my $file ($dh->read) { +#next unless $file =~ /\.pl$/; +#$rl->handler("/registry_bb/$file"); +#} +#} 1;
cvs commit: modperl-2.0/t/response/TestModperl dir_config.pm
stas02/05/19 00:53:27 Modified:t/response/TestModperl dir_config.pm Log: test that sub-section overrides parent section for the same key Revision ChangesPath 1.4 +9 -2 modperl-2.0/t/response/TestModperl/dir_config.pm Index: dir_config.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/dir_config.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- dir_config.pm 11 Apr 2002 11:08:44 - 1.3 +++ dir_config.pm 19 May 2002 07:53:27 - 1.4 @@ -16,7 +16,7 @@ sub handler { my $r = shift; -plan $r, tests => 12; +plan $r, tests => 13; #Apache::RequestRec::dir_config tests @@ -38,6 +38,13 @@ 'testing PerlAddVar ITERATE2'); } +# sub-section overrides parent section for the same key +{ +my $key = 'TestModperl__server_rec_Key_set_in_Base'; +ok t_cmp('SubSecValue', $r->dir_config->get($key), + "sub-section overrides parent section for the same key"); +} + { my $key = make_key('0'); @@ -159,4 +166,4 @@ PerlAddVar TestModperl__request_rec_Key1 2_AddValue PerlAddVar TestModperl__request_rec_Key1 3_AddValue 4_AddValue -PerlSetVar TestModperl__server_rec_Key_set_in_Base WhatEver +PerlSetVar TestModperl__server_rec_Key_set_in_Base SubSecValue
cvs commit: modperl-2.0/t/response/TestModperl dir_config.pm
stas02/05/19 01:55:55 Modified:t/response/TestModperl dir_config.pm Log: test that a sub-section inherits from super-section if it doesn't override it Revision ChangesPath 1.5 +12 -4 modperl-2.0/t/response/TestModperl/dir_config.pm Index: dir_config.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/dir_config.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- dir_config.pm 19 May 2002 07:53:27 - 1.4 +++ dir_config.pm 19 May 2002 08:55:54 - 1.5 @@ -16,7 +16,7 @@ sub handler { my $r = shift; -plan $r, tests => 13; +plan $r, tests => 14; #Apache::RequestRec::dir_config tests @@ -35,14 +35,22 @@ my @expected = qw(1_SetValue 2_AddValue 3_AddValue 4_AddValue); ok t_cmp(\@expected, \@received, - 'testing PerlAddVar ITERATE2'); + 'PerlAddVar ITERATE2'); } -# sub-section overrides parent section for the same key +# sub-section inherits from super-section if it doesn't override it +{ +my $key = 'TestModperl__request_rec_Key_set_in_Base'; +ok t_cmp('BaseValue', $r->dir_config->get($key), + "sub-section inherits from super-section if" . + "it doesn't override it"); +} + +# sub-section overrides super-section for the same key { my $key = 'TestModperl__server_rec_Key_set_in_Base'; ok t_cmp('SubSecValue', $r->dir_config->get($key), - "sub-section overrides parent section for the same key"); + "sub-section overrides super-section for the same key"); } {
cvs commit: modperl-2.0/t/response/TestModperl dir_config.pm
stas02/05/19 02:05:15 Modified:t/response/TestModperl dir_config.pm Log: - the last added sub-test was a duplicate, merge the two - make the debug comments more user-friendly Revision ChangesPath 1.6 +13 -20modperl-2.0/t/response/TestModperl/dir_config.pm Index: dir_config.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/dir_config.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- dir_config.pm 19 May 2002 08:55:54 - 1.5 +++ dir_config.pm 19 May 2002 09:05:15 - 1.6 @@ -16,7 +16,7 @@ sub handler { my $r = shift; -plan $r, tests => 14; +plan $r, tests => 13; #Apache::RequestRec::dir_config tests @@ -40,10 +40,11 @@ # sub-section inherits from super-section if it doesn't override it { -my $key = 'TestModperl__request_rec_Key_set_in_Base'; -ok t_cmp('BaseValue', $r->dir_config->get($key), - "sub-section inherits from super-section if" . - "it doesn't override it"); +my $key = make_key('_set_in_Base'); +ok t_cmp('BaseValue', + $r->dir_config($key), + "sub-section inherits from super-section " . + "if it doesn't override it"); } # sub-section overrides super-section for the same key @@ -60,13 +61,13 @@ # PerlSetVar key) ok t_cmp('SetValue0', $dir_config->get($key), - qq{\$dir_config->get("$key")}); + "table get() in a scalar context"); -# direct fetch test in a scalar context (for a single -# PerlSetVar) +# direct fetch test in a scalar context (for a single +# PerlSetVar key) ok t_cmp('SetValue0', $r->dir_config($key), - qq{\$r->dir_config("$key")}); + "direct value fetch in a scalar context"); } # test non-existent key @@ -75,7 +76,7 @@ ok t_cmp(undef, $r->dir_config($key), - qq{\$r->dir_config("$key")}); + "non-existent key"); } # test set interface @@ -87,7 +88,7 @@ ok t_cmp($val, $r->dir_config($key), - qq{\$r->dir_config($key => "$val")}); + "set && get"); } # test unset interface @@ -99,17 +100,9 @@ ok t_cmp(undef, $r->dir_config($key), - qq{\$r->dir_config($key => undef)}); + "unset"); } -# test PerlSetVar set in base config -{ -my $key = make_key('_set_in_Base'); - -ok t_cmp("BaseValue", - $r->dir_config($key), - qq{\$r->dir_config("$key")}); -} #Apache::Server::dir_config tests
cvs commit: modperl-2.0 STATUS
stas02/05/19 02:28:06 Added: .STATUS Log: start the STATUS file Revision ChangesPath 1.1 modperl-2.0/STATUS Index: STATUS === mod_perl 2.0 STATUS: -*-text-*- Last modified at [$Date: 2002/05/19 09:28:06 $] Release: 1.99_02-dev: In development. 1.99_01: Released April 06, 2002 Release Showstoppers: - * Report: Status: Available Patches: -- Needs Patch or Further Investigation: - Open Issues or Core Enhancements: - Documentation: -- Patches unlikely to be applied: --- * Report: Status:
cvs commit: modperl-2.0 README
stas02/05/19 02:33:03 Modified:.README Log: - add a pointer to /docs - update the requirement to 2.0.37 Revision ChangesPath 1.4 +4 -1 modperl-2.0/README Index: README === RCS file: /home/cvs/modperl-2.0/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- README7 Apr 2002 00:27:59 - 1.3 +++ README19 May 2002 09:33:03 - 1.4 @@ -1,6 +1,6 @@ This is mod_perl version 2.0-tobe -Apache version 2.0.35 or higher is required. +Apache version 2.0.37 or higher is required. Perl version 5.6.0 or higher is required. @@ -10,6 +10,9 @@ Only DSO build of mod_perl-2.0 is currently supported, static builds will be support in the future. + +docs are available in /docs. Currently they don't get installed on +'make install'. Certain API documentation can be found in docs/api/. mod_perl-2.0-tobe is not 100% feature complete with the 1.xx version. See the todo/ directory for what remains to be done.
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
stas02/05/19 04:41:53 Modified:.Changes lib/Apache compat.pm t/response/TestApache compat2.pm Log: add the err_header_out() wrapper to Apache::compat + corresponding tests. Revision ChangesPath 1.11 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Changes 14 May 2002 01:14:19 - 1.10 +++ Changes 19 May 2002 11:41:53 - 1.11 @@ -10,6 +10,8 @@ =item 1.99_02-dev +add the err_header_out() wrapper to Apache::compat + corresponding tests + add Apache::Util::unescape_uri alias to Apache::unescape_url in Apache::compat change Apache::unescape_url to return the escaped url as 1.x does 1.45 +8 -0 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.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- compat.pm 18 May 2002 01:12:15 - 1.44 +++ compat.pm 19 May 2002 11:41:53 - 1.45 @@ -142,6 +142,14 @@ : scalar($r->table_get_set(scalar($r->headers_in), @_)); } +sub err_header_out { +my $r = shift; +return wantarray() +? ($r->table_get_set(scalar($r->err_headers_out), @_)) +: scalar($r->table_get_set(scalar($r->err_headers_out), @_)); +} + + sub register_cleanup { shift->pool->cleanup_register(@_); } 1.7 +47 -43modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- compat2.pm14 May 2002 01:14:19 - 1.6 +++ compat2.pm19 May 2002 11:41:53 - 1.7 @@ -24,7 +24,7 @@ sub handler { my $r = shift; -plan $r, tests => 35; +plan $r, tests => 39; $r->send_http_header('text/plain'); @@ -35,51 +35,55 @@ ok t_cmp('GLOB', ref($fh), "Apache->gensym"); # test header_in and header_out -for my $way (qw(in out)) { -my $sub_test = "header_$way"; -my $sub_good = "headers_$way"; -my $key = 'header-test'; - -# scalar context -{ -my $key; -if ($way eq 'in') { -$key = "user-agent"; # should exist with lwp +# and err_header_out +for my $prefix ('err_', '') { +my @ways = 'out'; +push @ways, 'in' unless $prefix; +for my $way (@ways) { +my $sub_test = "${prefix}header_$way"; +my $sub_good = "${prefix}headers_$way"; +my $key = 'header-test'; + +# scalar context +{ +my $key; +if ($way eq 'in') { +$key = "user-agent"; # should exist with lwp +} else { +# outgoing headers aren't set yet, so we set one +$key = "X-barabara"; +$r->$sub_good->set($key, $key x 2); +} + +ok t_cmp($r->$sub_good->get($key), + $r->$sub_test($key), + "\$r->$sub_test in scalar context"); } -else { -# outgoing headers aren't set yet, so we set one -$key = "X-barabara"; -$r->$sub_good->set($key, $key x 2); + +# list context +{ +my @exp = qw(foo bar); +$r->$sub_good->add($key => $_) for @exp; +ok t_cmp(\@exp, + [ $r->$sub_test($key) ], + "\$r->$sub_test in list context"); +} + +# set +{ +my $exp = $key x 2; +$r->$sub_test($key => $exp); +my $got = $r->$sub_test($key); +ok t_cmp($exp, $got, "\$r->$sub_test set()"); } -ok t_cmp($r->$sub_good->get($key), - $r->$sub_test($key), - "\$r->$sub_test in scalar context"); -} - -# list context -
cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in
stas02/05/21 22:40:48 Modified:ModPerl-Registry MANIFEST ModPerl-Registry/t basic.t closure.t special_blocks.t ModPerl-Registry/t/conf extra.conf.in Removed: ModPerl-Registry/lib/ModPerl RegistryNG.pm Log: Apache::RegistryNG is now ModPerl::Registry, no need for NG version anymore Revision ChangesPath 1.3 +0 -1 modperl-2.0/ModPerl-Registry/MANIFEST Index: MANIFEST === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/MANIFEST,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MANIFEST 11 Oct 2001 19:50:20 - 1.2 +++ MANIFEST 22 May 2002 05:40:48 - 1.3 @@ -6,7 +6,6 @@ lib/ModPerl/Registry.pm lib/ModPerl/RegistryBB.pm lib/ModPerl/RegistryCooker.pm -lib/ModPerl/RegistryNG.pm t/TEST.PL t/basic.t t/closure.t 1.5 +0 -1 modperl-2.0/ModPerl-Registry/t/basic.t Index: basic.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- basic.t 5 Apr 2002 18:44:39 - 1.4 +++ basic.t 22 May 2002 05:40:48 - 1.5 @@ -8,7 +8,6 @@ my %modules = (registry=> 'ModPerl::Registry', - registry_ng => 'ModPerl::RegistryNG', registry_bb => 'ModPerl::RegistryBB', perlrun => 'ModPerl::PerlRun', ); 1.5 +1 -1 modperl-2.0/ModPerl-Registry/t/closure.t Index: closure.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/closure.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- closure.t 19 Oct 2001 06:52:57 - 1.4 +++ closure.t 22 May 2002 05:40:48 - 1.5 @@ -13,7 +13,7 @@ # interpreter all the time (in case that the server is running more # than one interpreter) -my @modules = qw(registry registry_ng registry_bb perlrun); +my @modules = qw(registry registry_bb perlrun); plan tests => 6; 1.4 +0 -1 modperl-2.0/ModPerl-Registry/t/special_blocks.t Index: special_blocks.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/special_blocks.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- special_blocks.t 14 May 2002 15:47:12 - 1.3 +++ special_blocks.t 22 May 2002 05:40:48 - 1.4 @@ -9,7 +9,6 @@ my %modules = ( registry=> 'ModPerl::Registry', -registry_ng => 'ModPerl::RegistryNG', registry_bb => 'ModPerl::RegistryBB', perlrun => 'ModPerl::PerlRun', ); 1.5 +0 -19 modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in Index: extra.conf.in === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- extra.conf.in 14 May 2002 15:55:21 - 1.4 +++ extra.conf.in 22 May 2002 05:40:48 - 1.5 @@ -31,20 +31,10 @@ ### Normal registry setup ### # Alias /registry/ @ServerRoot@/cgi-bin/ -Alias /registry_ng/ @ServerRoot@/cgi-bin/ Alias /registry_bb/ @ServerRoot@/cgi-bin/ Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/ Alias /perlrun/ @ServerRoot@/cgi-bin/ -PerlModule ModPerl::RegistryNG - -PerlOptions +GlobalRequest -SetHandler perl-script -Options +ExecCGI -PerlResponseHandler ModPerl::RegistryNG -PerlOptions +ParseHeaders - - PerlModule ModPerl::RegistryBB PerlOptions +GlobalRequest @@ -86,20 +76,11 @@ ### Alias /same_interp/registry/ @ServerRoot@/cgi-bin/ -Alias /same_interp/registry_ng/ @ServerRoot@/cgi-bin/ Alias /same_interp/registry_bb/ @ServerRoot@/cgi-bin/ Alias /same_interp/registry_oo_conf/ @ServerRoot@/cgi-bin/ Alias /same_interp/perlrun/ @ServerRoot@/cgi-bin/ PerlModule Apache::TestHandler - -PerlOptions +GlobalRequest -SetHandler perl-script -Options +ExecCGI -PerlFixupHandler Apache::TestHandler::same_interp_fixup -PerlResponseHandler ModPerl::RegistryNG -PerlOptions +ParseHeaders - PerlOptions +GlobalRequest
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryBB.pm Registry.pm
stas02/05/21 22:41:48 Modified:ModPerl-Registry/lib/ModPerl RegistryBB.pm Registry.pm Log: the pod part moves into its own file Revision ChangesPath 1.2 +0 -14 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm Index: RegistryBB.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RegistryBB.pm 9 Oct 2001 12:47:38 - 1.1 +++ RegistryBB.pm 22 May 2002 05:41:48 - 1.2 @@ -24,17 +24,3 @@ 1; __END__ - -=head1 NAME - -ModPerl::RegistryBB - - -=head1 SYNOPSIS - -=head1 DESCRIPTION - -C uses all the defaults, which do the very minimum -to compile the file once and run it many times. - -=cut - 1.2 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Registry.pm 9 Oct 2001 12:47:38 - 1.1 +++ Registry.pm 22 May 2002 05:41:48 - 1.2 @@ -61,7 +61,7 @@ # # META: if the ISA search results are cached on the first lookup, may -# be need to alias only the those that aren't the defaults? +# be we need to alias only those methods that override the defaults? 1;
cvs commit: modperl-2.0/t/protocol eliza.t
stas02/05/22 12:43:45 Modified:t/protocol eliza.t Log: improve the dialog Revision ChangesPath 1.4 +3 -3 modperl-2.0/t/protocol/eliza.t Index: eliza.t === RCS file: /home/cvs/modperl-2.0/t/protocol/eliza.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- eliza.t 1 Jan 2002 10:44:30 - 1.3 +++ eliza.t 22 May 2002 19:43:45 - 1.4 @@ -6,10 +6,10 @@ use Apache::TestRequest (); my @test_strings = ('Hello Eliza', -'How are you', +'How are you?', 'Why do I have core dumped?', -'I feel like writing some tests today, you?', -'good bye'); +'I feel like writing some tests today, what about you?', +'Good bye, Eliza'); plan tests => 1 + @test_strings, have_module 'Chatbot::Eliza';
cvs commit: modperl-2.0/t/protocol/TestProtocol eliza.pm
stas02/05/22 12:49:28 Modified:t/protocol/TestProtocol eliza.pm Log: adjust the handler for the changed dialog ending Revision ChangesPath 1.4 +1 -1 modperl-2.0/t/protocol/TestProtocol/eliza.pm Index: eliza.pm === RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/eliza.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- eliza.pm 11 Apr 2002 11:08:43 - 1.3 +++ eliza.pm 22 May 2002 19:49:28 - 1.4 @@ -26,7 +26,7 @@ $socket->recv($buff, $rlen); last if $rlen <= 0; chomp $buff; -$last++ if $buff eq 'good bye'; +$last++ if $buff eq 'Good bye, Eliza'; $buff = $mybot->transform( $buff ) . "\n"; $socket->send($buff, length $buff); last if $last;
cvs commit: modperl-2.0/lib/Apache Build.pm
stas02/05/28 20:26:40 Modified:lib/Apache Build.pm Log: check that MP_AP_PREFIX is set before using it Revision ChangesPath 1.94 +2 -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.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- Build.pm 23 May 2002 23:36:31 - 1.93 +++ Build.pm 29 May 2002 03:26:40 - 1.94 @@ -72,6 +72,8 @@ sub ap_prefix_is_source_tree { my $self = shift; +return unless exists $self->{MP_AP_PREFIX}; + my $prefix = $self->{MP_AP_PREFIX}; -d $prefix and -e "$prefix/CHANGES";
cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in
stas2002/06/02 05:58:35 Modified:ModPerl-Registry/t/conf extra.conf.in Log: s/Mblib=/I/ so it'll work on darwin/5.6.0 Revision ChangesPath 1.6 +7 -7 modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in Index: extra.conf.in === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- extra.conf.in 22 May 2002 05:40:48 - 1.5 +++ extra.conf.in 2 Jun 2002 12:58:35 - 1.6 @@ -5,13 +5,13 @@ PerlModule Apache2 -PerlSwitches -Mlib=@ServerRoot@/../lib \ - -Mlib=@ServerRoot@/../../Apache-Test/lib \ - -Mlib=@ServerRoot@/../../lib \ - -Mlib=@ServerRoot@/../../blib/lib/Apache2 \ - -Mlib=@ServerRoot@/../../blib/arch/Apache2 \ - -Mlib=@ServerRoot@/../../blib/lib \ - -Mlib=@ServerRoot@/../../blib/arch +PerlSwitches -I@ServerRoot@/../lib \ + -I@ServerRoot@/../../Apache-Test/lib \ + -I@ServerRoot@/../../lib \ + -I@ServerRoot@/../../blib/lib/Apache2 \ + -I@ServerRoot@/../../blib/arch/Apache2 \ + -I@ServerRoot@/../../blib/lib \ + -I@ServerRoot@/../../blib/arch # run on startup PerlRequire @ServerRoot@/conf/modperl_extra_startup.pl
cvs commit: modperl-2.0/t/response/TestModperl subenv.pm
stas2002/06/02 06:28:18 Modified:t/response/TestModperl subenv.pm Log: no logic change, just re-grouping the code so it's easier to read what's being tested Revision ChangesPath 1.2 +3 -14 modperl-2.0/t/response/TestModperl/subenv.pm Index: subenv.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/subenv.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- subenv.pm 21 May 2002 02:50:39 - 1.1 +++ subenv.pm 2 Jun 2002 13:28:18 - 1.2 @@ -16,27 +16,22 @@ plan $r, tests => 16; my $env = $r->subprocess_env; - ok $env; +# subprocess_env in void context populates the same as +SetEnv ok_false($r, 'REMOTE_ADDR'); - -$r->subprocess_env; #void context populates +$r->subprocess_env; +ok_true($r, 'REMOTE_ADDR'); $env = $r->subprocess_env; #table may have been overlayed -ok_true($r, 'REMOTE_ADDR'); - $env->set(FOO => 1); - ok_true($r, 'FOO'); $r->subprocess_env(FOO => undef); - ok_false($r, 'FOO'); $r->subprocess_env(FOO => 1); - ok_true($r, 'FOO'); Apache::OK; @@ -46,11 +41,8 @@ my($r, $key) = @_; my $env = $r->subprocess_env; - ok $env->get($key); - ok $env->{$key}; - ok $r->subprocess_env($key); } @@ -58,11 +50,8 @@ my($r, $key) = @_; my $env = $r->subprocess_env; - ok ! $env->get($key); - ok ! $env->{$key}; - ok ! $r->subprocess_env($key); }
cvs commit: modperl-2.0/todo deprecated_features.txt
stas2002/06/04 01:43:51 Modified:todo deprecated_features.txt Log: PerlFreshRestart has been documented in compat.pod Revision ChangesPath 1.6 +0 -2 modperl-2.0/todo/deprecated_features.txt Index: deprecated_features.txt === RCS file: /home/cvs/modperl-2.0/todo/deprecated_features.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- deprecated_features.txt 25 May 2002 17:50:39 - 1.5 +++ deprecated_features.txt 4 Jun 2002 08:43:51 - 1.6 @@ -6,8 +6,6 @@ - MaxModPerlRequestsPerChild -- PerlFreshRestart (we now do a full teardown/startup of interpreters) - - $r->seqno, $r->sent_header, $r->cgi_env, $r->cgi_var, $r->query_string, $r->basic_http_header, $r->new_read, $r->write_client, $r->read_client_block, $r->translate_name
cvs commit: modperl-2.0 Changes
stas2002/06/04 05:40:53 Modified:lib/Apache compat.pm t/response/TestApache compat2.pm .Changes Log: added compat for Apache::log_error() Revision ChangesPath 1.61 +4 -0 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.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- compat.pm 4 Jun 2002 00:44:23 - 1.60 +++ compat.pm 4 Jun 2002 12:40:53 - 1.61 @@ -104,6 +104,10 @@ exists_config_define(@_); } +sub log_error { +Apache->server->log_error(@_); +} + package Apache::Constants; use Apache::Const (); 1.17 +4 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- compat2.pm4 Jun 2002 00:44:23 - 1.16 +++ compat2.pm4 Jun 2002 12:40:53 - 1.17 @@ -24,7 +24,7 @@ sub handler { my $r = shift; -plan $r, tests => 47; +plan $r, tests => 48; $r->send_http_header('text/plain'); @@ -246,6 +246,9 @@ t_cmp(0, Apache::Util::validate_password("mguod", $hash)); $r->post_connection(sub { OK }); + +Apache::log_error("testing Apache::log_error"); +ok 1; OK; } 1.18 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Changes 2 Jun 2002 03:25:53 - 1.17 +++ Changes 4 Jun 2002 12:40:53 - 1.18 @@ -10,6 +10,8 @@ =item 1.99_03-dev +added compat for Apache::log_error [Stas Bekman] + =item 1.99_02 - June 1, 2002 pass the PATH and TZ environment variables at startup by default as 1.xx did
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
stas2002/06/04 06:04:47 Modified:t/response/TestAPI aplog.pm t/response/TestApache compat2.pm Log: add tests for 2 warn() aliases Revision ChangesPath 1.8 +3 -0 modperl-2.0/t/response/TestAPI/aplog.pm Index: aplog.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/aplog.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- aplog.pm 11 Apr 2002 11:08:43 - 1.7 +++ aplog.pm 4 Jun 2002 13:04:47 - 1.8 @@ -62,6 +62,9 @@ $s->loglevel(Apache::LOG_DEBUG); $slog->debug(sub { ok 1; "$package test done" }); +Apache->warn("Apache->warn test ok"); +$s->warn('$s->warn test ok'); + Apache::OK; } 1.18 +1 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- compat2.pm4 Jun 2002 12:40:53 - 1.17 +++ compat2.pm4 Jun 2002 13:04:47 - 1.18 @@ -247,7 +247,7 @@ $r->post_connection(sub { OK }); -Apache::log_error("testing Apache::log_error"); +Apache::log_error("Apache::log_error test ok"); ok 1; OK;
cvs commit: modperl-2.0/t/protocol/TestProtocol eliza.pm
stas2002/06/14 03:06:16 Modified:t/protocol eliza.t t/protocol/TestProtocol eliza.pm Log: - test that Eliza has actually closed the loop - adjust the eliza handler to work over the telnet client as well, where \r is sent instead of \n Revision ChangesPath 1.5 +9 -2 modperl-2.0/t/protocol/eliza.t Index: eliza.t === RCS file: /home/cvs/modperl-2.0/t/protocol/eliza.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- eliza.t 22 May 2002 19:43:45 - 1.4 +++ eliza.t 14 Jun 2002 10:06:16 - 1.5 @@ -11,7 +11,7 @@ 'I feel like writing some tests today, what about you?', 'Good bye, Eliza'); -plan tests => 1 + @test_strings, have_module 'Chatbot::Eliza'; +plan tests => 2 + @test_strings, have_module 'Chatbot::Eliza'; my $socket = Apache::TestRequest::vhost_socket('TestProtocol::eliza'); @@ -19,8 +19,15 @@ for (@test_strings) { print $socket "$_\n"; -chomp(my $reply = <$socket>); +chomp(my $reply = <$socket> || ''); t_debug "send: $_"; t_debug "recv: $reply"; ok $reply; } + +# at this point 'Good bye, Eliza' should abort the connection. +my $string = 'Eliza should not hear this'; +print $socket "$string\n"; +chomp(my $reply = <$socket> || ''); +t_debug "Eliza shouldn't respond anymore"; +ok !$reply; 1.5 +4 -2 modperl-2.0/t/protocol/TestProtocol/eliza.pm Index: eliza.pm === RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/eliza.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- eliza.pm 22 May 2002 19:49:28 - 1.4 +++ eliza.pm 14 Jun 2002 10:06:16 - 1.5 @@ -25,8 +25,10 @@ $rlen = BUFF_LEN; $socket->recv($buff, $rlen); last if $rlen <= 0; -chomp $buff; -$last++ if $buff eq 'Good bye, Eliza'; + +# \r is sent instead of \n if the client is talking over telnet +$buff =~ s/[\r\n]*$//; +$last++ if $buff eq "Good bye, Eliza"; $buff = $mybot->transform( $buff ) . "\n"; $socket->send($buff, length $buff); last if $last;
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/06/14 21:51:25 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: properly propogate back the error codes and abort where things fail Revision ChangesPath 1.8 +3 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- RegistryCooker.pm 14 May 2002 15:45:06 - 1.7 +++ RegistryCooker.pm 15 Jun 2002 04:51:25 - 1.8 @@ -144,7 +144,8 @@ if ($o->should_compile) { my $rc = $o->can_compile; return $rc unless $rc == Apache::OK; -$o->convert_script_to_compiled_handler; +$rc = $o->convert_script_to_compiled_handler; +return $rc unless $rc == Apache::OK; } return $o->run; @@ -333,6 +334,7 @@ my %orig_inc = %INC; my $rc = $o->compile(\$eval); +return $rc unless $rc == Apache::OK; $o->debug(qq{compiled package \"$o->[PACKAGE]\"}) if DEBUG & D_NOISE; #$o->chdir_file("$Apache::Server::CWD/");
cvs commit: modperl-2.0/t/response/TestAPR perlio.pm
stas2002/06/15 12:08:21 Modified:t/response/TestAPR perlio.pm Log: disable the failing tests with 5.8.0-RC2 while reworking APR PerlIO layer Revision ChangesPath 1.9 +1 -1 modperl-2.0/t/response/TestAPR/perlio.pm Index: perlio.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- perlio.pm 31 May 2002 02:19:11 - 1.8 +++ perlio.pm 15 Jun 2002 19:08:21 - 1.9 @@ -27,7 +27,7 @@ #$tests += $lfs_tests if USE_LARGE_FILES; #XXX -plan $r, tests => $tests, have_perl 'iolayers'; +plan $r, tests => $tests, todo => [5,8], have_perl 'iolayers'; my $vars = Apache::Test::config()->{vars}; my $dir = catfile $vars->{documentroot}, "perlio";
cvs commit: modperl-2.0 README
stas2002/06/15 12:15:52 Modified:.README Log: - add the URL for the docs (not the final location yet) - add a pointer to the doc explaining how to report bugs Revision ChangesPath 1.6 +4 -0 modperl-2.0/README Index: README === RCS file: /home/cvs/modperl-2.0/README,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- README19 May 2002 19:08:11 - 1.5 +++ README15 Jun 2002 19:15:52 - 1.6 @@ -13,12 +13,16 @@ docs are available in /docs. Currently they don't get installed on 'make install'. Certain API documentation can be found in docs/api/. +the online version is at http://perl.apache.org/release/. mod_perl-2.0-tobe is not 100% feature complete with the 1.xx version. See the todo/ directory for what remains to be done. For comments, questions, bug-reports, etc., join the mod_perl users list by sending mail to [EMAIL PROTECTED] + +when reporting bugs please follow the instructions at: +http://perl.apache.org/release/docs/2.0/user/help/help.html#Reporting_Problems For announcements join the mod_perl announce list by sending mail to [EMAIL PROTECTED]
cvs commit: modperl-2.0 STATUS
stas2002/06/20 11:31:16 Modified:.STATUS Log: log the Apache::Log issues for a future resolution Revision ChangesPath 1.4 +43 -7 modperl-2.0/STATUS Index: STATUS === RCS file: /home/cvs/modperl-2.0/STATUS,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- STATUS4 Jun 2002 13:01:20 - 1.3 +++ STATUS20 Jun 2002 18:31:16 - 1.4 @@ -4,9 +4,10 @@ Release: - 1.99_03-dev: In development - 1.99_02-dev: Released June 01, 2002 - 1.99_01: Released April 06, 2002 + 1.99_04-dev: In development + 1.99_03-dev: Released Jun 16, 2002 + 1.99_02-dev: Released Jun 01, 2002 + 1.99_01: Released Apr 06, 2002 === @@ -28,6 +29,15 @@ Available Patches: -- +* Fixing Apache->warn("foo") + Report: Message-ID: <[EMAIL PROTECTED]> + Status: pending Apache::Log compat issues, this and other methods + might be dropped. + + +* + Report: + Status: Needs Patch or Further Investigation: - @@ -36,6 +46,32 @@ Open Issues or Core Enhancements: - +* Apache::Log compat issues: + + Apache->warn, Apache::warn, Apache::Server->warn and + Apache->Apache::Server->log_error are all doing: + s = modperl_global_get_server_rec(); + and this function is thread safe only during the startup. + + possible solutions: + + 1) enforce that these functions are used only at the server startup + + 2) require +GlobalRequest, which gives us r->server, now thread + safe (though slow). + + 3) drop them all from the API and move to compat. + [remember that Apache::warn is needed for registry scripts to + override warn()] + + Report: Message-ID: <[EMAIL PROTECTED]> + Status: + + + +* + Report: + Status: Documentation: -- @@ -44,7 +80,7 @@ Patches unlikely to be applied: --- - * - Report: - Status: +* + Report: + Status:
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c apr_perlio.h
stas2002/06/21 08:28:44 Modified:t/response/TestAPR perlio.pm xs/APR/PerlIO apr_perlio.c apr_perlio.h Log: APR PerlIO updates: - make the apr layer independent from PerlIOBuf - sync with the latest PerlIO API changes - cleanup - add a new test for buffered write - prepare for the future possible LARGE_FILES_CONFLICT constant, for seek tests Revision ChangesPath 1.11 +20 -8 modperl-2.0/t/response/TestAPR/perlio.pm Index: perlio.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- perlio.pm 15 Jun 2002 23:48:58 - 1.10 +++ perlio.pm 21 Jun 2002 15:28:43 - 1.11 @@ -12,6 +12,10 @@ use Apache::Const -compile => 'OK'; use constant HAVE_PERLIO => eval { require APR::PerlIO }; +#XXX: feel free to enable if largefile support is not enabled in Perl +#XXX: APR::LARGE_FILES_CONFLICT constant? +use constant LARGE_FILES_CONFLICT => 1; + sub handler { my $r = shift; @@ -22,10 +26,10 @@ return Apache::OK; } -my $tests = 2; #XXX 11; +my $tests = 12; my $lfs_tests = 3; -#$tests += $lfs_tests if USE_LARGE_FILES; #XXX +$tests += $lfs_tests unless LARGE_FILES_CONFLICT; plan $r, tests => $tests, have_perl 'iolayers'; @@ -36,6 +40,7 @@ my $sep = "-- sep --\n"; my @lines = ("This is a test: $$\n", "test line --sep two\n"); + my $expected = $lines[0]; my $expected_all = join $sep, @lines; @@ -66,10 +71,9 @@ "expected failure"); } } -return Apache::OK; #XXX remove when perlio issues are sorted out + # seek/tell() tests -#XXX: feel free to enable if largefile support is not enabled in Perl -if (0) { +unless (LARGE_FILES_CONFLICT) { open my $fh, "<:APR", $file, $r or die "Cannot open $file for reading: $!"; @@ -132,7 +136,7 @@ my @expect = ($lines[0] . $sep, $lines[1]); ok t_cmp(\@expect, \@got_lines, - "adjusted input record sep read"); + "custom complex input record sep read"); close $fh; } @@ -179,17 +183,25 @@ { open my $wfh, ">:APR", $file, $r or die "Cannot open $file for writing: $!"; +open my $rfh, "<:APR", $file, $r +or die "Cannot open $file for reading: $!"; my $expected = "This is an un buffering write test"; # unbuffer my $oldfh = select($wfh); $| = 1; select($oldfh); print $wfh $expected; # must be flushed to disk immediately -open my $rfh, "<:APR", $file, $r -or die "Cannot open $file for reading: $!"; ok t_cmp($expected, scalar(<$rfh>), "file unbuffered write"); + +# buffer up +$oldfh = select($wfh); $| = 0; select($oldfh); +print $wfh $expected; # must be flushed to disk immediately + +ok t_cmp(undef, + scalar(<$rfh>), + "file buffered write"); close $wfh; close $rfh; 1.16 +102 -47 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- apr_perlio.c 21 Jun 2002 02:06:48 - 1.15 +++ apr_perlio.c 21 Jun 2002 15:28:43 - 1.16 @@ -10,23 +10,37 @@ * The PerlIO API is documented in perliol.pod. **/ +/* + * APR::PerlIO implements a PerlIO layer using apr_file_io as the core. + */ + +/* + * XXX: Since we cannot snoop on the internal apr_file_io buffer + * currently the IO is not buffered on the Perl side so every read + * requests a char at a time, which is slow. Consider copying the + * relevant code from PerlIOBuf to implement our own buffer, similar + * to what PerlIOBuf does or push :perlio layer on top of this layer + */ + typedef struct { -PerlIOBuf base;/* PerlIOBuf stuff */ +struct _PerlIO base; apr_file_t *file; apr_pool_t *pool; } PerlIOAPR; -/* clean up any structures linked from PerlIOAPR. a layer can be - * popped without being closed if the program is dynamically managing -
cvs commit: modperl-2.0/t/response/TestAPR perlio.pm
stas2002/06/21 08:45:06 Modified:t/response/TestAPR perlio.pm Log: only a comments fixes Revision ChangesPath 1.12 +2 -2 modperl-2.0/t/response/TestAPR/perlio.pm Index: perlio.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- perlio.pm 21 Jun 2002 15:28:43 - 1.11 +++ perlio.pm 21 Jun 2002 15:45:06 - 1.12 @@ -12,8 +12,8 @@ use Apache::Const -compile => 'OK'; use constant HAVE_PERLIO => eval { require APR::PerlIO }; -#XXX: feel free to enable if largefile support is not enabled in Perl #XXX: APR::LARGE_FILES_CONFLICT constant? +#XXX: you can set to zero if largefile support is not enabled in Perl use constant LARGE_FILES_CONFLICT => 1; sub handler { @@ -197,7 +197,7 @@ # buffer up $oldfh = select($wfh); $| = 0; select($oldfh); -print $wfh $expected; # must be flushed to disk immediately +print $wfh $expected; # should be buffered up and not flushed ok t_cmp(undef, scalar(<$rfh>),
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/06/21 08:53:40 Modified:xs/APR/PerlIO apr_perlio.c Log: a few minor fixes and cleanups Revision ChangesPath 1.17 +3 -7 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- apr_perlio.c 21 Jun 2002 15:28:43 - 1.16 +++ apr_perlio.c 21 Jun 2002 15:53:40 - 1.17 @@ -28,7 +28,6 @@ apr_pool_t *pool; } PerlIOAPR; - static IV PerlIOAPR_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg) { IV code = PerlIOBase_pushed(aTHX_ f, mode, arg); @@ -40,7 +39,6 @@ return code; } - static PerlIO *PerlIOAPR_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, @@ -147,7 +145,6 @@ return NULL; } - static SSize_t PerlIOAPR_read(pTHX_ PerlIO *f, void *vbuf, Size_t count) { PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR); @@ -159,8 +156,8 @@ return count; } else if (rc != APR_SUCCESS) { -char errbuf[120]; #ifdef PERLIO_APR_DEBUG +char errbuf[120]; /* XXX: need to figure way to map APR errno to normal errno, * so we can use SETERRNO to make the apr errors available to * Perl's $! */ @@ -203,6 +200,7 @@ return 0; } +PerlIOBase(f)->flags |= PERLIO_F_ERROR; return -1; } @@ -225,7 +223,7 @@ /* Flush the fill buffer */ if (PerlIO_flush(f) != 0) { - return -1; +return -1; } switch(whence) { @@ -366,8 +364,6 @@ return -1; } - - static PerlIO_funcs PerlIO_APR = { "APR",
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/06/21 10:37:38 Modified:xs/APR/PerlIO apr_perlio.c Log: adjust for PerlIO bleedperl changes Revision ChangesPath 1.18 +3 -2 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- apr_perlio.c 21 Jun 2002 15:53:40 - 1.17 +++ apr_perlio.c 21 Jun 2002 17:37:38 - 1.18 @@ -28,9 +28,9 @@ apr_pool_t *pool; } PerlIOAPR; -static IV PerlIOAPR_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg) +static IV PerlIOAPR_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab) { -IV code = PerlIOBase_pushed(aTHX_ f, mode, arg); +IV code = PerlIOBase_pushed(aTHX_ f, mode, arg, tab); if (*PerlIONext(f)) { /* XXX: not sure if we can do anything here, but see * PerlIOUnix_pushed for things that it does @@ -366,6 +366,7 @@ } static PerlIO_funcs PerlIO_APR = { +sizeof(PerlIO_funcs), "APR", sizeof(PerlIOAPR), PERLIO_K_MULTIARG,
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/06/21 10:40:18 Modified:xs/APR/PerlIO apr_perlio.c Log: wrap the long args line Revision ChangesPath 1.19 +2 -1 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_perlio.c 21 Jun 2002 17:37:38 - 1.18 +++ apr_perlio.c 21 Jun 2002 17:40:18 - 1.19 @@ -28,7 +28,8 @@ apr_pool_t *pool; } PerlIOAPR; -static IV PerlIOAPR_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab) +static IV PerlIOAPR_pushed(pTHX_ PerlIO *f, const char *mode, + SV *arg, PerlIO_funcs *tab) { IV code = PerlIOBase_pushed(aTHX_ f, mode, arg, tab); if (*PerlIONext(f)) {
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
stas2002/06/26 09:16:58 Modified:t/response/TestApache compat2.pm Log: add Apache->module compat tests Revision ChangesPath 1.19 +9 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- compat2.pm4 Jun 2002 13:04:47 - 1.18 +++ compat2.pm26 Jun 2002 16:16:58 - 1.19 @@ -24,15 +24,23 @@ sub handler { my $r = shift; -plan $r, tests => 48; +plan $r, tests => 50; $r->send_http_header('text/plain'); my $cfg = Apache::Test::config(); my $vars = $cfg->{vars}; +### Apache-> tests my $fh = Apache->gensym; ok t_cmp('GLOB', ref($fh), "Apache->gensym"); + +ok t_cmp(1, Apache->module('mod_perl.c'), + "Apache::module('mod_perl.c')"); +ok t_cmp(0, Apache->module('mod_ne_exists.c'), + "Apache::module('mod_ne_exists.c')"); + +### $r-> tests # test header_in and header_out # and err_header_out
cvs commit: modperl-2.0 README
stas2002/06/26 23:36:03 Modified:.README Log: update requirements Revision ChangesPath 1.7 +4 -3 modperl-2.0/README Index: README === RCS file: /home/cvs/modperl-2.0/README,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- README15 Jun 2002 19:15:52 - 1.6 +++ README27 Jun 2002 06:36:03 - 1.7 @@ -1,8 +1,9 @@ This is mod_perl version 2.0-tobe -Apache version 2.0.36 or higher is required. +Apache version 2.0.39 or higher is required. -Perl version 5.6.0 or higher is required. +Perl version 5.6.0 or higher is required. Perl-5.8.0-RC2 if you build +with 5.8.0 series. mod_perl is currently considered beta when used with the prefork MPM. @@ -13,7 +14,7 @@ docs are available in /docs. Currently they don't get installed on 'make install'. Certain API documentation can be found in docs/api/. -the online version is at http://perl.apache.org/release/. +the online version is at http://perl.apache.org/release/docs). mod_perl-2.0-tobe is not 100% feature complete with the 1.xx version. See the todo/ directory for what remains to be done.
cvs commit: modperl-2.0/lib/Apache compat.pm
stas2002/06/30 21:54:09 Modified:lib/Apache compat.pm Log: make sure that the call is made as Apache->module($name) (2 arguments) and not Apache::module($name) Revision ChangesPath 1.62 +1 -0 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.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- compat.pm 4 Jun 2002 12:40:53 - 1.61 +++ compat.pm 1 Jul 2002 04:54:09 - 1.62 @@ -92,6 +92,7 @@ sub module { require Apache::Module; +die 'Usage: Apache->module($name)' if @_ != 2; return Apache::Module::loaded($_[1]); }
cvs commit: modperl-2.0/lib/Apache compat.pm
stas2002/06/30 21:55:42 Modified:lib/Apache compat.pm Log: enable warnings Revision ChangesPath 1.63 +1 -0 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.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- compat.pm 1 Jul 2002 04:54:09 - 1.62 +++ compat.pm 1 Jul 2002 04:55:42 - 1.63 @@ -1,6 +1,7 @@ package Apache::compat; use strict; +use warnings FATAL => 'all'; #1.xx compat layer #some of this will stay as-is
cvs commit: modperl-2.0/t/response/TestAPI module.pm
stas2002/06/30 22:15:28 Modified:src/modules/perl modperl_util.c t/response/TestAPI module.pm Log: modperl_perl_module_loaded should return FALSE when the argument is "" + add a sub-test to cover this case Revision ChangesPath 1.48 +1 -1 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.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- modperl_util.c21 Jun 2002 00:44:24 - 1.47 +++ modperl_util.c1 Jul 2002 05:15:28 - 1.48 @@ -602,7 +602,7 @@ MP_INLINE int modperl_perl_module_loaded(pTHX_ const char *name) { -return gv_stashpv(name, FALSE) ? 1 : 0; +return (*name && gv_stashpv(name, FALSE)) ? 1 : 0; } /* same as Symbol::gensym() */ 1.8 +4 -1 modperl-2.0/t/response/TestAPI/module.pm Index: module.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- module.pm 19 May 2002 19:10:45 - 1.7 +++ module.pm 1 Jul 2002 05:15:28 - 1.8 @@ -18,7 +18,7 @@ my $cfg = Apache::Test::config(); -plan $r, tests => 13; +plan $r, tests => 14; my $top_module = Apache::Module->top_module; @@ -91,6 +91,9 @@ #bogus ok t_cmp(0, Apache::Module::loaded('Apache__Module_foo.foo'), "Apache::Module::loaded('Apache__Module_foo.foo')"); + +ok t_cmp(0, Apache::Module::loaded(''), + "Apache::Module::loaded('')"); Apache::OK; }
cvs commit: modperl-2.0/xs/Apache/Filter Apache__Filter.h
stas2002/07/01 00:08:45 Modified:xs/Apache/Filter Apache__Filter.h Log: fix a typo: s/output/input/ Revision ChangesPath 1.19 +1 -1 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.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Apache__Filter.h 25 Jan 2002 04:04:22 - 1.18 +++ Apache__Filter.h 1 Jul 2002 07:08:45 - 1.19 @@ -2,7 +2,7 @@ ap_add_output_filter(name, ctx, r, NULL) #define mpxs_Apache__RequestRec_add_input_filter(r, name, ctx) \ -ap_add_output_filter(name, ctx, r, NULL) +ap_add_input_filter(name, ctx, r, NULL) #define mp_xs_sv2_modperl_filter(sv) \ ((SvROK(sv) && (SvTYPE(SvRV(sv)) == SVt_PVMG)) \
cvs commit: modperl-2.0/t/response/TestAPR perlio.pm
stas2002/07/06 05:16:14 Modified:t/response/TestAPR perlio.pm Log: make the error messages comparison work under locale Submitted by: Tatsuhiko Miyagawa <[EMAIL PROTECTED]> Revision ChangesPath 1.14 +6 -1 modperl-2.0/t/response/TestAPR/perlio.pm Index: perlio.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- perlio.pm 21 Jun 2002 22:21:37 - 1.13 +++ perlio.pm 6 Jul 2002 12:16:14 - 1.14 @@ -58,6 +58,11 @@ # open() failure test { +# workaround for locale setups where the error message may be +# in a different language +open my $fh, "perlio_this_file_cannot_exist"; +my $errno_string = "$!"; + # non-existant file my $file = "/this/file/does/not/exist"; if (open my $fh, "<:APR", $file, $r) { @@ -66,7 +71,7 @@ close $fh; } else { -ok t_cmp('No such file or directory', +ok t_cmp($errno_string, "$!", "expected failure"); }
cvs commit: modperl-2.0/xs/APR/Table APR__Table.h
stas2002/07/08 23:52:08 Modified:xs/APR/Table APR__Table.h Log: apr_table_t is now an opaque type, use apr_table_elts() to get the array record Revision ChangesPath 1.8 +1 -1 modperl-2.0/xs/APR/Table/APR__Table.h Index: APR__Table.h === RCS file: /home/cvs/modperl-2.0/xs/APR/Table/APR__Table.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- APR__Table.h 12 Nov 2001 22:14:36 - 1.7 +++ APR__Table.h 9 Jul 2002 06:52:08 - 1.8 @@ -70,7 +70,7 @@ char *filter_entry; STRLEN len; -tdata.filter = apr_hash_make(table->a.pool); +tdata.filter = apr_hash_make(apr_table_elts(table)->pool); while (MARK <= SP) { filter_entry = SvPV(*MARK, len);
cvs commit: modperl-2.0/xs/Apache/SubProcess Apache__SubProcess.h
stas2002/07/10 23:14:10 Modified:xs typemap xs/Apache/SubProcess Apache__SubProcess.h Log: use the new time conversion macros: apr_time_* Revision ChangesPath 1.9 +2 -2 modperl-2.0/xs/typemap Index: typemap === RCS file: /home/cvs/modperl-2.0/xs/typemap,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- typemap 24 May 2002 04:42:57 - 1.8 +++ typemap 11 Jul 2002 06:14:10 - 1.9 @@ -15,7 +15,7 @@ sv_setiv($arg, PTR2IV($var)); T_APR_TIME - sv_setnv($arg, (NV)($var / APR_USEC_PER_SEC)); + sv_setnv($arg, (NV)(apr_time_sec($var))); T_UVOBJ modperl_perl_sv_setref_uv(aTHX_ $arg, \"${ntype}\", (UV)$var); @@ -58,7 +58,7 @@ $var = INT2PTR($type,SvIV(SvROK($arg) ? SvRV($arg) : $arg)) T_APR_TIME - $var = (apr_time_t)(SvNV($arg) * APR_USEC_PER_SEC) + $var = (apr_time_t)(apr_time_from_sec(SvNV($arg))) T_CHAR_LEN $var = (char *)SvPV($arg, ${var}_len) 1.11 +1 -1 modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h Index: Apache__SubProcess.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/SubProcess/Apache__SubProcess.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Apache__SubProcess.h 15 Mar 2002 04:29:25 - 1.10 +++ Apache__SubProcess.h 11 Jul 2002 06:14:10 - 1.11 @@ -20,7 +20,7 @@ #define SET_TIMEOUT(fp) \ apr_file_pipe_timeout_set(fp, \ - (int)(r->server->timeout * APR_USEC_PER_SEC)) + (int)(apr_time_from_sec(r->server->timeout))) static int modperl_spawn_proc_prog(pTHX_ request_rec *r,
cvs commit: modperl-2.0/src/modules/perl modperl_apache_includes.h
stas2002/07/11 11:25:55 Modified:src/modules/perl modperl_apache_includes.h Log: add apr_time_* back-compat macros Revision ChangesPath 1.16 +13 -0 modperl-2.0/src/modules/perl/modperl_apache_includes.h Index: modperl_apache_includes.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_apache_includes.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- modperl_apache_includes.h 28 May 2002 00:42:58 - 1.15 +++ modperl_apache_includes.h 11 Jul 2002 18:25:55 - 1.16 @@ -32,4 +32,17 @@ typedef unsigned long apr_os_thread_t; #endif +/* XXX: these backcompat macros can be deleted when we bump up the + * minimal supported httpd version to 2.0.40 or higher + */ +#ifndef apr_time_sec +#define apr_time_sec(time) ((apr_int64_t)((time) / APR_USEC_PER_SEC)) +#endif +#ifndef apr_time_usec +#define apr_time_usec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC)) +#endif +#ifndef apr_time_from_sec +#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) +#endif + #endif /* MODPERL_APACHE_INCLUDES_H */
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/07/30 02:44:03 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: disable the taint warning till we get the taint flag set on -T Revision ChangesPath 1.9 +4 -3 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- RegistryCooker.pm 15 Jun 2002 04:51:25 - 1.8 +++ RegistryCooker.pm 30 Jul 2002 09:44:03 - 1.9 @@ -525,9 +525,10 @@ my %switches = ( 'T' => sub { - Apache::warn("T switch is ignored, ". - "enable with 'PerlSwitches -T' in httpd.conf\n") -unless $Apache::__T; ""; +# XXX: need to have $Apache::__T set by the core on PerlSwitches -T +# Apache::warn("T switch is ignored, ", +#"enable with 'PerlSwitches -T' in httpd.conf\n") +# unless $Apache::__T; ""; }, 'w' => sub { "use warnings;\n" }, );
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/07/30 11:27:17 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: the switch callback function must return a defined value Revision ChangesPath 1.10 +2 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- RegistryCooker.pm 30 Jul 2002 09:44:03 - 1.9 +++ RegistryCooker.pm 30 Jul 2002 18:27:16 - 1.10 @@ -528,7 +528,8 @@ # XXX: need to have $Apache::__T set by the core on PerlSwitches -T # Apache::warn("T switch is ignored, ", #"enable with 'PerlSwitches -T' in httpd.conf\n") -# unless $Apache::__T; ""; +# unless $Apache::__T; + ""; }, 'w' => sub { "use warnings;\n" }, );
cvs commit: modperl-2.0 Changes
stas2002/07/31 09:32:40 Modified:t/response/TestApache compat2.pm lib/Apache compat.pm .Changes Log: added $r->get_remote_host to compat.pm + test Revision ChangesPath 1.20 +4 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- compat2.pm26 Jun 2002 16:16:58 - 1.19 +++ compat2.pm31 Jul 2002 16:32:40 - 1.20 @@ -24,7 +24,7 @@ sub handler { my $r = shift; -plan $r, tests => 50; +plan $r, tests => 51; $r->send_http_header('text/plain'); @@ -192,6 +192,9 @@ ok t_cmp($time, $r->mtime, "\$r->set_last_modified(\$time)"); } + +# $r->get_remote_host +ok $r->get_remote_host() || 1; # Apache::Util::size_string { 1.64 +4 -0 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.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- compat.pm 1 Jul 2002 04:55:42 - 1.63 +++ compat.pm 31 Jul 2002 16:32:40 - 1.64 @@ -200,6 +200,10 @@ shift->connection->pool->cleanup_register(@_); } +sub get_remote_host { +shift->connection->remote_host(@_); +} + sub parse_args { my($r, $string) = @_; return () unless defined $string and $string; 1.30 +2 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- Changes 21 Jun 2002 22:35:49 - 1.29 +++ Changes 31 Jul 2002 16:32:40 - 1.30 @@ -12,6 +12,8 @@ =item 1.99_04 - June 21, 2002 +added $r->get_remote_host to compat.pm + test [Stas Bekman] + various APR PerlIO updates [Stas Bekman] stop using an apr_pool_t to allocate items for the interpreter pool,
cvs commit: modperl-2.0/lib/Apache Build.pm
stas2002/08/13 19:33:01 Modified:lib/Apache Build.pm Log: apxs post-2.0.40 adds a new line, so we strip it Revision ChangesPath 1.103 +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.102 retrieving revision 1.103 diff -u -r1.102 -r1.103 --- Build.pm 23 Jun 2002 21:46:09 - 1.102 +++ Build.pm 14 Aug 2002 02:33:00 - 1.103 @@ -123,6 +123,7 @@ } my $val = qx($apxs @_ 2>/dev/null); +chomp $val if defined $val; # apxs post-2.0.40 adds a new line unless ($val) { error "'$apxs @_' failed:";
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/14 05:52:37 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: sync with 1.0 registry: check that the prototype is defined in flush_namespace Revision ChangesPath 1.11 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- RegistryCooker.pm 30 Jul 2002 18:27:16 - 1.10 +++ RegistryCooker.pm 14 Aug 2002 12:52:37 - 1.11 @@ -479,7 +479,7 @@ if (defined &$fullname) { no warnings; local $^W = 0; -if (my $p = prototype $fullname) { +if (defined(my $p = prototype $fullname)) { *{$fullname} = eval "sub ($p) {}"; } else {
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm RegistryBB.pm
stas2002/08/14 07:27:03 Modified:ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm RegistryBB.pm Log: use the base pragma instead of @ISA Revision ChangesPath 1.2 +1 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm Index: PerlRun.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PerlRun.pm9 Oct 2001 12:47:38 - 1.1 +++ PerlRun.pm14 Aug 2002 14:27:03 - 1.2 @@ -8,8 +8,7 @@ our $VERSION = '1.99'; -use ModPerl::RegistryCooker; -@ModPerl::PerlRun::ISA = qw(ModPerl::RegistryCooker); +use base qw(ModPerl::RegistryCooker); # META: prototyping ($$) segfaults on request sub handler { 1.3 +1 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Registry.pm 22 May 2002 05:41:48 - 1.2 +++ Registry.pm 14 Aug 2002 14:27:03 - 1.3 @@ -8,8 +8,7 @@ our $VERSION = '1.99'; -use ModPerl::RegistryCooker; -@ModPerl::Registry::ISA = qw(ModPerl::RegistryCooker); +use base qw(ModPerl::RegistryCooker); sub handler { my $class = (@_ >= 2) ? shift : __PACKAGE__; 1.3 +1 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm Index: RegistryBB.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RegistryBB.pm 22 May 2002 05:41:48 - 1.2 +++ RegistryBB.pm 14 Aug 2002 14:27:03 - 1.3 @@ -8,8 +8,7 @@ our $VERSION = '1.99'; -use ModPerl::RegistryCooker; -@ModPerl::RegistryBB::ISA = qw(ModPerl::RegistryCooker); +use base qw(ModPerl::RegistryCooker); # META: prototyping ($$) segfaults on request sub handler {
cvs commit: modperl-2.0/ModPerl-Registry/t basic.t
stas2002/08/14 07:27:45 Modified:ModPerl-Registry/t basic.t Log: reformat the code according to the spec Revision ChangesPath 1.6 +24 -24modperl-2.0/ModPerl-Registry/t/basic.t Index: basic.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- basic.t 22 May 2002 05:40:48 - 1.5 +++ basic.t 14 Aug 2002 14:27:45 - 1.6 @@ -6,11 +6,11 @@ use Apache::TestRequest qw(GET_BODY HEAD); -my %modules = -(registry=> 'ModPerl::Registry', - registry_bb => 'ModPerl::RegistryBB', - perlrun => 'ModPerl::PerlRun', -); +my %modules = ( +registry=> 'ModPerl::Registry', +registry_bb => 'ModPerl::RegistryBB', +perlrun => 'ModPerl::PerlRun', +); my @aliases = sort keys %modules; @@ -21,10 +21,10 @@ my $url = "/$alias/basic.pl"; ok t_cmp( - "ok", - GET_BODY($url), - "$modules{$alias} basic cgi test", -); +"ok", +GET_BODY($url), +"$modules{$alias} basic cgi test", +); } # test non-executable bit @@ -32,10 +32,10 @@ my $url = "/$alias/not_executable.pl"; ok t_cmp( - "403 Forbidden", - HEAD($url)->status_line(), - "$modules{$alias} non-executable file", -); +"403 Forbidden", +HEAD($url)->status_line(), +"$modules{$alias} non-executable file", +); } # test environment pre-set @@ -43,22 +43,22 @@ my $url = "/$alias/env.pl?foo=bar"; ok t_cmp( - "foo=bar", - GET_BODY($url), - "$modules{$alias} mod_cgi-like environment pre-set", -); +"foo=bar", +GET_BODY($url), +"$modules{$alias} mod_cgi-like environment pre-set", +); } -# chdir is not safe yet! -# -# require (actually chdir test) +# XXX: chdir is not safe yet! + +## require (actually chdir test) #for my $alias (@aliases) { #my $url = "/$alias/require.pl"; #ok t_cmp( -# "it works", -# GET_BODY($url), -# "$modules{$alias} mod_cgi-like environment pre-set", -#); +#"it works", +#GET_BODY($url), +#"$modules{$alias} mod_cgi-like environment pre-set", +#); #}
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/14 07:38:07 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: syncing with 1.0's registry: geoff's patch to set error-notes on error Revision ChangesPath 1.12 +7 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- RegistryCooker.pm 14 Aug 2002 12:52:37 - 1.11 +++ RegistryCooker.pm 14 Aug 2002 14:38:07 - 1.12 @@ -205,7 +205,7 @@ my $r = $o->[REQ]; unless (-r $r->finfo && -s _) { -$r->log_error("$$: $o->[FILENAME] not found or unable to stat"); +xlog_error($r, "$$: $o->[FILENAME] not found or unable to stat"); return Apache::NOT_FOUND; } @@ -649,7 +649,7 @@ sub error_check { my $o = shift; if ($@ and substr($@,0,4) ne " at ") { - $o->[REQ]->log_error("$$: $o->[CLASS]: `$@'"); + xlog_error($o->[REQ], "$$: $o->[CLASS]: `$@'"); $@{$o->[REQ]->uri} = $@; #$@ = ''; #XXX fix me, if we don't do this Apache::exit() breaks return Apache::SERVER_ERROR; @@ -688,6 +688,11 @@ $o->[REQ]->log_error("$$: $o->[CLASS]: " . join '', @_); } +sub xlog_error { +my($r, $msg) = @_; +$r->log_error($msg); +$r->notes('error-notes', $msg); +} 1; __END__
cvs commit: modperl-2.0/xs/Apache/RequestIO Apache__RequestIO.h
stas2002/08/14 07:54:47 Modified:src/modules/perl modperl_filter.c modperl_log.h t/response/TestAPI aplog.pm xs/Apache/Log Apache__Log.h xs/Apache/RequestIO Apache__RequestIO.h Log: eliminate the use of the deprecated APLOG_NOERRNO macro Revision ChangesPath 1.37 +1 -1 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.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- modperl_filter.c 29 Jun 2002 20:38:33 - 1.36 +++ modperl_filter.c 14 Aug 2002 14:54:47 - 1.37 @@ -18,7 +18,7 @@ return APR_SUCCESS; /* XXX: HTTP_MOVED_TEMPORARILY ? */ } else if (status != OK) { -ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, +ap_log_error(APLOG_MARK, APLOG_WARNING, 0, r->server, "%s did not send an HTTP header", r->uri); } 1.10 +5 -5 modperl-2.0/src/modules/perl/modperl_log.h Index: modperl_log.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_log.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- modperl_log.h 21 Jun 2002 20:30:27 - 1.9 +++ modperl_log.h 14 Aug 2002 14:54:47 - 1.10 @@ -39,19 +39,19 @@ void modperl_trace_level_set(server_rec *s, const char *level); #define modperl_log_warn(s,msg) \ -ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, s, "%s", msg) +ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, "%s", msg) #define modperl_log_error(s,msg) \ -ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, s, "%s", msg) +ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "%s", msg) #define modperl_log_notice(s,msg) \ -ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, s, "%s", msg) +ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, "%s", msg) #define modperl_log_debug(s,msg) \ -ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, s, "%s", msg) +ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "%s", msg) #define modperl_log_reason(r,msg,file) \ -ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r->server, \ +ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, \ "access to %s failed for %s, reason: %s", \ file, \ get_remote_host(r->connection, \ 1.9 +1 -1 modperl-2.0/t/response/TestAPI/aplog.pm Index: aplog.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/aplog.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- aplog.pm 4 Jun 2002 13:04:47 - 1.8 +++ aplog.pm 14 Aug 2002 14:54:47 - 1.9 @@ -46,7 +46,7 @@ $s->log_serror(Apache::LOG_MARK, Apache::LOG_DEBUG, APR::ENOTIME, "log_serror test 2 ok"); -$r->log_rerror(Apache::LOG_MARK, Apache::LOG_DEBUG|Apache::LOG_NOERRNO, +$r->log_rerror(Apache::LOG_MARK, Apache::LOG_DEBUG, APR::ENOTIME, "log_rerror test ok"); $r->log_error('$r->log_error test ok'); 1.11 +2 -2 modperl-2.0/xs/Apache/Log/Apache__Log.h Index: Apache__Log.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Log/Apache__Log.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Apache__Log.h 19 Jun 2002 05:18:04 - 1.10 +++ Apache__Log.h 14 Aug 2002 14:54:47 - 1.11 @@ -57,10 +57,10 @@ } if (r) { -ap_log_rerror(file, line, APLOG_NOERRNO|level, 0, r, "%s", str); +ap_log_rerror(file, line, level, 0, r, "%s", str); } else { -ap_log_error(file, line, APLOG_NOERRNO|level, 0, s, "%s", str); +ap_log_error(file, line, level, 0, s, "%s", str); } if (svstr) { 1.28 +1 -2 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.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Apache__RequestIO.h 30 May 2002 02:33:48 - 1.27 +++ Apache__Req
cvs commit: modperl-2.0/t/compat - New directory
stas2002/08/14 08:08:36 modperl-2.0/t/compat - New directory
cvs commit: modperl-2.0/t/response/TestCompat - New directory
stas2002/08/14 08:08:36 modperl-2.0/t/response/TestCompat - New directory
cvs commit: modperl-2.0/t/response/TestApache compat.pm compat2.pm
stas2002/08/14 08:12:55 Added: t/compat compat.t t/response/TestCompat compat2.pm compat.pm Removed: t/apache compat.t t/response/TestApache compat.pm compat2.pm Log: moving compat testa into their own group, preparing for the split into several compat tests Revision ChangesPath 1.1 modperl-2.0/t/compat/compat.t Index: compat.t === use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestRequest; plan tests => 3; my $location = "/TestCompat::compat"; # $r->send_http_header('text/plain'); { my @data = (test => 'content-type'); ok t_cmp( "text/plain", HEAD(query(@data))->content_type(), q{$r->send_http_header('text/plain')} ); } # $r->content { my @data = (test => 'content'); my $content = join '=', @data; ok t_cmp( "@data", POST_BODY($location, content => $content), q{$r->content via POST} ); } # $r->Apache::args { my @data = (test => 'args'); ok t_cmp( "@data", GET_BODY(query(@data)), q{$r->Apache::args} ); } ### helper subs ### sub query { my(%args) = (@_ % 2) ? %{+shift} : @_; "$location?" . join '&', map { "$_=$args{$_}" } keys %args; } # accepts multiline var where, the lines matching: # ^ok\n$ results in ok(1) # ^nok\n$ results in ok(0) # the rest is printed as is sub ok_nok { for (split /\n/, shift) { if (/^ok\n?$/) { ok 1; } elsif (/^nok\n?$/) { ok 0; } else { print "$_\n"; } } } 1.1 modperl-2.0/t/response/TestCompat/compat2.pm Index: compat2.pm === package TestCompat::compat2; # these Apache::compat tests are all run and validated on the server # side. See also TestCompat::compat. use strict; use warnings FATAL => 'all'; use Apache::TestUtil; use Apache::Test; use Apache::compat (); use Apache::Constants qw(OK); my %string_size = ( '-1'=> "-", 0 => " 0k", 42 => " 1k", 42_000 => " 41k", 42_000_000 => "40.1M", 42_000_000_000 => "40054M", ); sub handler { my $r = shift; plan $r, tests => 51; $r->send_http_header('text/plain'); my $cfg = Apache::Test::config(); my $vars = $cfg->{vars}; ### Apache-> tests my $fh = Apache->gensym; ok t_cmp('GLOB', ref($fh), "Apache->gensym"); ok t_cmp(1, Apache->module('mod_perl.c'), "Apache::module('mod_perl.c')"); ok t_cmp(0, Apache->module('mod_ne_exists.c'), "Apache::module('mod_ne_exists.c')"); ### $r-> tests # test header_in and header_out # and err_header_out for my $prefix ('err_', '') { my @ways = 'out'; push @ways, 'in' unless $prefix; for my $way (@ways) { my $sub_test = "${prefix}header_$way"; my $sub_good = "${prefix}headers_$way"; my $key = 'header-test'; # scalar context { my $key; if ($way eq 'in') { $key = "user-agent"; # should exist with lwp } else { # outgoing headers aren't set yet, so we set one $key = "X-barabara"; $r->$sub_good->set($key, $key x 2); } ok t_cmp($r->$sub_good->get($key), $r->$sub_test($key), "\$r->$sub_test in scalar context"); } # list context { my @exp = qw(foo bar); $r->$sub_good->add($key => $_) for @exp; ok t_cmp(\@exp, [ $r->$sub_test($key) ], "\$r->$sub_test in list context"); } # set { my $exp = $key x 2;
cvs commit: modperl-2.0/lib/Apache Build.pm
stas2002/08/14 19:10:32 Modified:lib/Apache Build.pm Log: make it possible to build mod_perl against the source tree, where apr.h is located in srclib/include/apr/ and not include/ Revision ChangesPath 1.104 +6 -1 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.103 retrieving revision 1.104 diff -u -r1.103 -r1.104 --- Build.pm 14 Aug 2002 02:33:00 - 1.103 +++ Build.pm 15 Aug 2002 02:10:32 - 1.104 @@ -765,7 +765,12 @@ my $dir = $self->ap_includedir; -my $header = "$dir/apr.h"; +my $header; +for my $d ($dir, "$dir/../srclib/apr/include") { +$header = "$d/apr.h"; +last if -e $header; +} + open my $fh, $header or do { error "Unable to open $header: $!"; return undef;
cvs commit: modperl-2.0/lib/Apache ParseSource.pm
stas2002/08/14 19:44:08 Modified:lib/Apache ParseSource.pm Log: skip the deprecated define APLOG_NOERRNO Revision ChangesPath 1.40 +1 -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.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- ParseSource.pm25 May 2002 18:17:09 - 1.39 +++ ParseSource.pm15 Aug 2002 02:44:08 - 1.40 @@ -191,7 +191,7 @@ ); my $defines_unwanted = join '|', qw{ -HTTP_VERSION APR_EOL_STR APLOG_MARK +HTTP_VERSION APR_EOL_STR APLOG_MARK APLOG_NOERRNO }; sub get_constants {
cvs commit: modperl-2.0/xs/maps apache_types.map
stas2002/08/14 19:51:19 Modified:xs/maps apache_types.map Log: add a typemap for 'int *' which is needed by ap_get_remote_host Revision ChangesPath 1.8 +1 -1 modperl-2.0/xs/maps/apache_types.map Index: apache_types.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_types.map,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- apache_types.map 26 Mar 2002 01:52:12 - 1.7 +++ apache_types.map 15 Aug 2002 02:51:19 - 1.8 @@ -43,7 +43,7 @@ ## Standard types ## int | IV -int * | UNDEFINED +int * | PTR unsigned int| UV signed int | IV long| IV
cvs commit: modperl-2.0/t/response/TestAPI conn_rec.pm
stas2002/08/15 01:42:55 Modified:xs/Apache/Connection Apache__Connection.h xs/maps modperl_functions.map apache_functions.map xs/tables/current/ModPerl FunctionTable.pm t/response/TestAPI conn_rec.pm Log: add a wrapper for ap_get_remote_host + tests Revision ChangesPath 1.4 +8 -0 modperl-2.0/xs/Apache/Connection/Apache__Connection.h Index: Apache__Connection.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Connection/Apache__Connection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Apache__Connection.h 30 Jan 2002 03:30:24 - 1.3 +++ Apache__Connection.h 15 Aug 2002 08:42:55 - 1.4 @@ -11,3 +11,11 @@ return socket; } + +static MP_INLINE +char *mpxs_Apache__Connection_get_remote_host(pTHX_ conn_rec *c, + int type, + apr_table_t *dir_config) +{ +return ap_get_remote_host(c, (void *)dir_config, type, NULL); +} 1.40 +2 -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.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- modperl_functions.map 21 May 2002 02:50:16 - 1.39 +++ modperl_functions.map 15 Aug 2002 08:42:55 - 1.40 @@ -64,6 +64,8 @@ MODULE=Apache::Connection mpxs_Apache__Connection_client_socket | | c, s=NULL + mpxs_Apache__Connection_get_remote_host | | c, type=REMOTE_NAME, dir_config=Nullsv + MODULE=Apache::Filter modperl_filter_attributes | MPXS_ | ... | MODIFY_CODE_ATTRIBUTES 1.56 +0 -1 modperl-2.0/xs/maps/apache_functions.map Index: apache_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- apache_functions.map 24 May 2002 17:37:08 - 1.55 +++ apache_functions.map 15 Aug 2002 08:42:55 - 1.56 @@ -170,7 +170,6 @@ ap_server_root_relative | mpxs_ | SV *:p, fname="" MODULE=Apache::Connection PACKAGE=guess - ap_get_remote_host #XXX: thought this might be useful for protocol modules #however it is not exported on win32 !ap_read_request 1.76 +22 -0 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- FunctionTable.pm 23 Jun 2002 21:28:15 - 1.75 +++ FunctionTable.pm 15 Aug 2002 08:42:55 - 1.76 @@ -4305,6 +4305,28 @@ ] }, { +'return_type' => 'char *', +'name' => 'mpxs_Apache__Connection_get_remote_host', +'args' => [ + { +'type' => 'PerlInterpreter *', +'name' => 'my_perl' + }, + { +'type' => 'conn_rec *', +'name' => 'c' + }, + { +'type' => 'int', +'name' => 'type' + }, + { +'type' => 'apr_table_t *', +'name' => 'dir_config' + } +] + }, + { 'return_type' => 'apr_size_t', 'name' => 'mpxs_Apache__Filter_print', 'attr' => [ 1.6 +18 -2 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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- conn_rec.pm 11 Apr 2002 11:08:43 - 1.5 +++ conn_rec.pm 15 Aug 2002 08:42:55 - 1.6 @@ -3,13 +3,15 @@ use strict; use warnings FATAL => 'all'; +use Apache::TestUtil; use Apache::Test; use Apache::RequestRec (); use Apache::RequestUtil (); use Apache::Connection (); -use Apache::Const -compile => 'OK'; +use Apache::Const -compile => qw(OK REMOTE_HOST REMOTE_NAME +REMOTE_NOLOOKUP REMOTE_DOUBLE_REV); #this test module is only for testing fields in the conn_rec #listed in apache_structures.map
cvs commit: modperl-2.0/t/response/TestCompat compat2.pm
stas2002/08/15 01:44:26 Modified:lib/Apache compat.pm t/response/TestCompat compat2.pm Log: $r->get_remote_host() compat wrapper ala mod_perl 1.0 + tests Revision ChangesPath 1.65 +5 -1 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.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- compat.pm 31 Jul 2002 16:32:40 - 1.64 +++ compat.pm 15 Aug 2002 08:44:26 - 1.65 @@ -127,6 +127,8 @@ package Apache::RequestRec; +use Apache::Const -compile => qw(REMOTE_NAME); + #no longer exist in 2.0 sub soft_timeout {} sub hard_timeout {} @@ -201,7 +203,9 @@ } sub get_remote_host { -shift->connection->remote_host(@_); +my($r, $type) = @_; +$type = Apache::REMOTE_NAME unless defined $type; +$r->connection->get_remote_host($type, $r->dir_config); } sub parse_args { 1.2 +3 -2 modperl-2.0/t/response/TestCompat/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/compat2.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- compat2.pm14 Aug 2002 15:12:55 - 1.1 +++ compat2.pm15 Aug 2002 08:44:26 - 1.2 @@ -10,7 +10,7 @@ use Apache::Test; use Apache::compat (); -use Apache::Constants qw(OK); +use Apache::Constants qw(OK REMOTE_HOST); my %string_size = ( '-1'=> "-", @@ -24,7 +24,7 @@ sub handler { my $r = shift; -plan $r, tests => 51; +plan $r, tests => 52; $r->send_http_header('text/plain'); @@ -195,6 +195,7 @@ # $r->get_remote_host ok $r->get_remote_host() || 1; +ok $r->get_remote_host(Apache::REMOTE_HOST) || 1; # Apache::Util::size_string {
cvs commit: modperl-2.0/t/response/TestCompat apache.pm apache_file.pm apache_table.pm apache_util.pm request.pm request_body.pm compat.pm compat2.pm
stas2002/08/15 02:35:11 Added: t/compat request_body.t t/response/TestCompat apache.pm apache_file.pm apache_table.pm apache_util.pm request.pm request_body.pm Removed: t/compat compat.t t/response/TestCompat compat.pm compat2.pm Log: split compat tests into small groups by the package they test Revision ChangesPath 1.1 modperl-2.0/t/compat/request_body.t Index: request_body.t === use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestRequest; plan tests => 3; my $location = "/TestCompat::request_body"; # $r->send_http_header('text/plain'); { my @data = (test => 'content-type'); ok t_cmp( "text/plain", HEAD(query(@data))->content_type(), q{$r->send_http_header('text/plain')} ); } # $r->content { my @data = (test => 'content'); my $content = join '=', @data; ok t_cmp( "@data", POST_BODY($location, content => $content), q{$r->content via POST} ); } # $r->Apache::args { my @data = (test => 'args'); ok t_cmp( "@data", GET_BODY(query(@data)), q{$r->Apache::args} ); } ### helper subs ### sub query { my(%args) = (@_ % 2) ? %{+shift} : @_; "$location?" . join '&', map { "$_=$args{$_}" } keys %args; } # accepts multiline var where, the lines matching: # ^ok\n$ results in ok(1) # ^nok\n$ results in ok(0) # the rest is printed as is sub ok_nok { for (split /\n/, shift) { if (/^ok\n?$/) { ok 1; } elsif (/^nok\n?$/) { ok 0; } else { print "$_\n"; } } } 1.1 modperl-2.0/t/response/TestCompat/apache.pm Index: apache.pm === package TestCompat::apache; # Apache->"method" and Apache::"function" compat layer tests # these tests are all run and validated on the server side. use strict; use warnings FATAL => 'all'; use Apache::TestUtil; use Apache::Test; use Apache::compat (); use Apache::Constants qw(OK); sub handler { my $r = shift; plan $r, tests => 5; $r->send_http_header('text/plain'); ### Apache-> tests my $fh = Apache->gensym; ok t_cmp('GLOB', ref($fh), "Apache->gensym"); ok t_cmp(1, Apache->module('mod_perl.c'), "Apache::module('mod_perl.c')"); ok t_cmp(0, Apache->module('mod_ne_exists.c'), "Apache::module('mod_ne_exists.c')"); ok t_cmp(Apache::exists_config_define('MODPERL2'), Apache->define('MODPERL2'), 'Apache->define'); Apache::log_error("Apache::log_error test ok"); ok 1; OK; } 1; 1.1 modperl-2.0/t/response/TestCompat/apache_file.pm Index: apache_file.pm === package TestCompat::apache_file; # Apache::File compat layer tests # these tests are all run and validated on the server side. use strict; use warnings FATAL => 'all'; use Apache::TestUtil; use Apache::Test; use Apache::compat (); use Apache::Constants qw(OK); sub handler { my $r = shift; plan $r, tests => 18; $r->send_http_header('text/plain'); my $cfg = Apache::Test::config(); my $vars = $cfg->{vars}; require Apache::File; my $file = $vars->{t_conf_file}; t_debug "new Apache::File file object"; ok my $fh = Apache::File->new; t_debug "open itself"; if ($fh->open($file)) { ok 1; t_debug "read from file"; my $read = <$fh>; ok $read; t_debug "close file"; ok $fh->close; } else { t_debug "open $file failed: $!"; ok 0; t_debug "ok: cannot read from the closed fh"; ok 1; t_debug "ok: close file should fail, wasn't opened"; ok !$fh->close; } t_debug "open non-exists"; ok !$fh->open("$file.n
cvs commit: modperl-2.0 Changes
stas2002/08/15 02:48:53 Modified:.Changes Log: document recent changes Revision ChangesPath 1.31 +14 -2 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Changes 31 Jul 2002 16:32:40 - 1.30 +++ Changes 15 Aug 2002 09:48:53 - 1.31 @@ -10,9 +10,21 @@ =item 1.99_05-dev -=item 1.99_04 - June 21, 2002 +compat tests were split into groups by functionality. [Stas Bekman] + +added $c->get_remote_host and a compat wrapper $r->get_remote_host + +tests [Stas Bekman] + +adjust the build system to support mod_perl build from the source +tree. [Stas Bekman] -added $r->get_remote_host to compat.pm + test [Stas Bekman] +ModPerl::RegistryCooker syncs with mod_perl 1.0's registry: + - prototypes defined checks in flush_namespace +[Yair Lenga <[EMAIL PROTECTED]>] + - set error-notes on error [Geoff Young <[EMAIL PROTECTED]>] + + +=item 1.99_04 - June 21, 2002 various APR PerlIO updates [Stas Bekman]
cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin closure.pl
stas2002/08/15 05:21:59 Modified:ModPerl-Registry/t/cgi-bin closure.pl Log: add a note so people won't get confused by closure warnings Revision ChangesPath 1.2 +4 -0 modperl-2.0/ModPerl-Registry/t/cgi-bin/closure.pl Index: closure.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/closure.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- closure.pl9 Oct 2001 12:47:38 - 1.1 +++ closure.pl15 Aug 2002 12:21:59 - 1.2 @@ -1,5 +1,9 @@ #!perl -w +BEGIN { +warn "note: the warning '... will not stay shared' is OK here!!!\n"; +} + # this script will suffer from a closure problem under registry # should see it under ::Registry # should not see it under ::PerlRun
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm RegistryCooker.pm
stas2002/08/15 05:29:06 Modified:ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm RegistryCooker.pm Log: - replace the hardcoded cache and root namespaces with flexible methods - get rid of the CLASS attribute and no strict 'refs' - avoid starting the autogenerated package with __ - make the helper function uncache_myself use the cache_table() method Revision ChangesPath 1.3 +23 -21modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm Index: PerlRun.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PerlRun.pm14 Aug 2002 14:27:03 - 1.2 +++ PerlRun.pm15 Aug 2002 12:29:06 - 1.3 @@ -23,27 +23,29 @@ # - speeds things up by shortcutting @ISA search, so even if the # default is used we still use the alias my %aliases = ( - new => 'new', - init=> 'init', - default_handler => 'default_handler', - run => 'run', - can_compile => 'can_compile', - make_namespace => 'make_namespace', - namespace_from => 'namespace_from_filename', - is_cached => 'FALSE', - should_compile => 'TRUE', - flush_namespace => 'flush_namespace_normal', - cache_it=> 'NOP', - read_script => 'read_script', - rewrite_shebang => 'rewrite_shebang', - set_script_name => 'set_script_name', - chdir_file => 'chdir_file_normal', - get_mark_line => 'get_mark_line', - compile => 'compile', - error_check => 'error_check', - strip_end_data_segment => 'strip_end_data_segment', - convert_script_to_compiled_handler => 'convert_script_to_compiled_handler', -); +new => 'new', +init=> 'init', +default_handler => 'default_handler', +run => 'run', +can_compile => 'can_compile', +make_namespace => 'make_namespace', +namespace_root => 'namespace_root_common', +namespace_from => 'namespace_from_filename', +is_cached => 'FALSE', +should_compile => 'TRUE', +flush_namespace => 'flush_namespace_normal', +cache_table => 'cache_table_common', +cache_it=> 'NOP', +read_script => 'read_script', +rewrite_shebang => 'rewrite_shebang', +set_script_name => 'set_script_name', +chdir_file => 'chdir_file_normal', +get_mark_line => 'get_mark_line', +compile => 'compile', +error_check => 'error_check', +strip_end_data_segment => 'strip_end_data_segment', +convert_script_to_compiled_handler => 'convert_script_to_compiled_handler', +); # in this module, all the methods are inherited from the same parent # class, so we fixup aliases instead of using the source package in 1.4 +23 -21modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Registry.pm 14 Aug 2002 14:27:03 - 1.3 +++ Registry.pm 15 Aug 2002 12:29:06 - 1.4 @@ -22,27 +22,29 @@ # - speeds things up by shortcutting @ISA search, so even if the # default is used we still use the alias my %aliases = ( - new => 'new', - init=> 'init', - default_handler => 'default_handler', - run => 'run', - can_compile => 'can_compile', - make_namespace => 'make_namespace', - namespace_from => 'namespace_from_filename', - is_cached => 'is_cached', - should_compile => 'should_compile_if_modified', - flush_namespace => 'NOP', - cache_it=> 'cache_it', - read_script => 'read_script', - rewrite_shebang => 'rewrite_shebang', - s
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/15 05:34:20 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: s/$o/$self/g, $o looks silly Revision ChangesPath 1.14 +113 -113 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- RegistryCooker.pm 15 Aug 2002 12:29:06 - 1.13 +++ RegistryCooker.pm 15 Aug 2002 12:34:20 - 1.14 @@ -87,9 +87,9 @@ sub new { my($class, $r) = @_; -my $o = bless [], $class; -$o->init($r); -return $o; +my $self = bless [], $class; +$self->init($r); +return $self; } # @@ -129,42 +129,42 @@ # func: default_handler # dflt: META: see above # desc: META: see above -# args: $o - registry blessed object +# args: $self - registry blessed object # rtrn: handler's response status # note: that's what most sub-class handlers will call # sub default_handler { -my $o = shift; +my $self = shift; -$o->make_namespace; +$self->make_namespace; -if ($o->should_compile) { -my $rc = $o->can_compile; +if ($self->should_compile) { +my $rc = $self->can_compile; return $rc unless $rc == Apache::OK; -$rc = $o->convert_script_to_compiled_handler; +$rc = $self->convert_script_to_compiled_handler; return $rc unless $rc == Apache::OK; } -return $o->run; +return $self->run; } # # func: run # dflt: run # desc: executes the compiled code -# args: $o - registry blessed object +# args: $self - registry blessed object # rtrn: execution status (Apache::?) # sub run { -my $o = shift; +my $self = shift; -my $r = $o->[REQ]; -my $package = $o->[PACKAGE]; +my $r = $self->[REQ]; +my $package = $self->[PACKAGE]; -$o->set_script_name; -$o->chdir_file; +$self->set_script_name; +$self->chdir_file; my $rc = Apache::OK; my $cv = \&{"$package\::handler"}; @@ -172,15 +172,15 @@ { # run the code and preserve warnings setup when it's done no warnings; eval { $rc = &{$cv}($r, @_) }; -$o->[STATUS] = $rc; +$self->[STATUS] = $rc; ModPerl::Global::special_list_call(END => $package); } -$o->flush_namespace; +$self->flush_namespace; -#$o->chdir_file("$Apache::Server::CWD/"); +#$self->chdir_file("$Apache::Server::CWD/"); -if ( ($rc = $o->error_check) != Apache::OK) { +if ( ($rc = $self->error_check) != Apache::OK) { return $rc; } @@ -193,37 +193,37 @@ # func: can_compile # dflt: can_compile # desc: checks whether the script is allowed and can be compiled -# args: $o - registry blessed object +# args: $self - registry blessed object # rtrn: $rc - return status to forward # efct: initializes the data object's fields: MTIME # sub can_compile { -my $o = shift; -my $r = $o->[REQ]; +my $self = shift; +my $r = $self->[REQ]; unless (-r $r->finfo && -s _) { -$o->log_error("$o->[FILENAME] not found or unable to stat"); +$self->log_error("$self->[FILENAME] not found or unable to stat"); return Apache::NOT_FOUND; } return Apache::DECLINED if -d _; -$o->[MTIME] = -M _; +$self->[MTIME] = -M _; unless (-x _ or IS_WIN32) { $r->log_reason("file permissions deny server execution", - $o->[FILENAME]); + $self->[FILENAME]); return Apache::FORBIDDEN; } if (!($r->allow_options & Apache::OPT_EXECCGI)) { $r->log_reason("Options ExecCGI is off in this directory", - $o->[FILENAME]); + $self->[FILENAME]); return Apache::FORBIDDEN; } -$o->debug("can compile $o->[FILENAME]") if DEBUG & D_NOISE; +$self->debug("can compile $self->[FILENAME]") if
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/15 05:59:38 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: move the setting of %@ into the log_error() method, so it'll be set on any errors Revision ChangesPath 1.15 +1 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- RegistryCooker.pm 15 Aug 2002 12:34:20 - 1.14 +++ RegistryCooker.pm 15 Aug 2002 12:59:38 - 1.15 @@ -656,8 +656,6 @@ my $self = shift; if ($@ and substr($@,0,4) ne " at ") { $self->log_error($@); - $@{$self->[REQ]->uri} = $@; - #$@ = ''; #XXX fix me, if we don't do this Apache::exit() breaks return Apache::SERVER_ERROR; } return Apache::OK; @@ -701,6 +699,7 @@ $self->[REQ]->log_error("$$: $class: $msg"); $self->[REQ]->notes('error-notes', $msg); +$@{$self->[URI]} = $msg; } #
cvs commit: modperl-2.0/t/response/TestAPI send_fd.pm
stas2002/08/15 06:11:06 Added: t/compat send_fd.t t/response/TestCompat send_fd.pm Removed: t/apisend_fd.t t/response/TestAPI send_fd.pm Log: send_fd exists only in compat, move that test into compat/ Revision ChangesPath 1.1 modperl-2.0/t/compat/send_fd.t Index: send_fd.t === use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestRequest; plan tests => 3; my $config = Apache::Test::config(); my $url = '/TestCompat::send_fd'; my $data = GET_BODY($url); ok $data; my $module = 'response/TestCompat/send_fd.pm'; ok length($data) == -s $module; $data = GET_BODY("$url?noexist.txt"); ok $data =~ /Not Found/; 1.1 modperl-2.0/t/response/TestCompat/send_fd.pm Index: send_fd.pm === package TestCompat::send_fd; use strict; use warnings FATAL => 'all'; use Apache::compat (); use Apache::RequestRec (); use Apache::Const -compile => ':common'; sub handler { my $r = shift; my $file = $r->args || __FILE__; open my $fh, $file or return Apache::NOT_FOUND; my $bytes = $r->send_fd($fh); return Apache::SERVER_ERROR unless $bytes == -s $file; Apache::OK; } 1;
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/15 07:26:10 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: sync with registry in mod_perl 1.0: properly handle return status Revision ChangesPath 1.16 +7 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- RegistryCooker.pm 15 Aug 2002 12:59:38 - 1.15 +++ RegistryCooker.pm 15 Aug 2002 14:26:10 - 1.16 @@ -146,7 +146,12 @@ return $rc unless $rc == Apache::OK; } -return $self->run; +# handlers shouldn't set $r->status but return it +my $old_status = $self->[REQ]->status; +my $rc = $self->run; +my $new_status = $self->[REQ]->status($old_status); + +return ($rc != Apache::OK) ? $rc : $new_status; } # @@ -178,7 +183,7 @@ $self->flush_namespace; -#$self->chdir_file("$Apache::Server::CWD/"); +#XXX: $self->chdir_file("$Apache::Server::CWD/"); if ( ($rc = $self->error_check) != Apache::OK) { return $rc;
cvs commit: modperl-2.0 STATUS
stas2002/08/15 08:22:02 Modified:.STATUS Log: add several from the many outstanding issues Revision ChangesPath 1.6 +24 -2 modperl-2.0/STATUS Index: STATUS === RCS file: /home/cvs/modperl-2.0/STATUS,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- STATUS21 Jun 2002 22:25:48 - 1.5 +++ STATUS15 Aug 2002 15:22:02 - 1.6 @@ -31,11 +31,21 @@ -- * Fixing Apache->warn("foo") - Report: Message-ID: <[EMAIL PROTECTED]> + + Report: http:[EMAIL PROTECTED] + Thread: http://mathforum.org/epigone/modperl-dev/noxtramcay Status: pending Apache::Log compat issues, this and other methods might be dropped. +* The Apache::Scoreboard XS implemenation with tests is awaiting to be + committed + + Report: http:[EMAIL PROTECTED] + Status: waiting for Doug's review + + + * Report: Status: @@ -70,9 +80,21 @@ +* we need a bug reporting utility that can be used post-install, which + should be similar to t/REPORT + + Report: http:[EMAIL PROTECTED] + thread: http://mathforum.org/epigone/modperl-dev/staiblirroo + Status: +1: Stas, Doug + needs to be implemented + + + * Report: Status: + + Documentation: --
cvs commit: modperl-2.0 Changes
stas2002/08/15 08:25:04 Modified:.Changes Log: document recent changes Revision ChangesPath 1.32 +7 -1 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- Changes 15 Aug 2002 09:48:53 - 1.31 +++ Changes 15 Aug 2002 15:25:04 - 1.32 @@ -10,7 +10,12 @@ =item 1.99_05-dev -compat tests were split into groups by functionality. [Stas Bekman] +core Registry packages all compile the scripts into +ModPerl::RegistryROOT:: namespace and cache them in +%ModPerl::RegistryCache. Both overridable by the sub-classes. [Stas Bekman] + +compat tests were split into groups by functionality, send_fd test +moved to compat. [Stas Bekman] added $c->get_remote_host and a compat wrapper $r->get_remote_host + tests [Stas Bekman] @@ -22,6 +27,7 @@ - prototypes defined checks in flush_namespace [Yair Lenga <[EMAIL PROTECTED]>] - set error-notes on error [Geoff Young <[EMAIL PROTECTED]>] + - preserve status in Registry scripts [Geoff Young <[EMAIL PROTECTED]>] =item 1.99_04 - June 21, 2002
cvs commit: modperl-2.0/ModPerl-Registry TODO
stas2002/08/15 09:16:24 Modified:ModPerl-Registry TODO Log: issues that have been taken care of Revision ChangesPath 1.8 +1 -9 modperl-2.0/ModPerl-Registry/TODO Index: TODO === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TODO 7 Dec 2001 18:12:17 - 1.7 +++ TODO 15 Aug 2002 16:16:24 - 1.8 @@ -6,15 +6,11 @@ ### bugs ### -- prototyping sub handler($$) segfaults on request - - consider not to use $$ in debug tracing. Not all platforms give out a different pid for different threads. ### missing features ### -- need to properly handle HEAD requests - - need to port $Apache::__T, to test against when user supplies -T flag. - port Apache::PerlRunXS @@ -53,10 +49,6 @@ ### optimizations ### -- $o->[CLASS] of the subclass is known at compile time, so should - create the subs using $o->[CLASS] on the fly for each subclass - which wants them - - currently the default is to strip __DATA__|__END__ and everything after that, which incurs a little overhead because of the s/// on the contents of the file. This "feature" wasn't in 1.x, so may @@ -88,7 +80,7 @@ - could also try to privide an optional workaround for the problem with libs collisions as explained here: - http://perl.apache.org/guide/porting.html#Name_collisions_with_Modules_and + http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and - It's a known kludge with mod_perl scripts coming from mod_cgi which use -M for file mtime comparisons, but are not aware of the fact
cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in
stas2002/08/15 09:17:53 Modified:ModPerl-Registry/lib/ModPerl PerlRun.pm Registry.pm RegistryBB.pm RegistryCooker.pm ModPerl-Registry/t basic.t ModPerl-Registry/t/conf extra.conf.in Log: method handlers are now working Revision ChangesPath 1.4 +1 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm Index: PerlRun.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PerlRun.pm15 Aug 2002 12:29:06 - 1.3 +++ PerlRun.pm15 Aug 2002 16:17:52 - 1.4 @@ -10,8 +10,7 @@ use base qw(ModPerl::RegistryCooker); -# META: prototyping ($$) segfaults on request -sub handler { +sub handler : method { my $class = (@_ >= 2) ? shift : __PACKAGE__; my $r = shift; return $class->new($r)->default_handler(); 1.5 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Registry.pm 15 Aug 2002 12:29:06 - 1.4 +++ Registry.pm 15 Aug 2002 16:17:52 - 1.5 @@ -10,7 +10,7 @@ use base qw(ModPerl::RegistryCooker); -sub handler { +sub handler : method { my $class = (@_ >= 2) ? shift : __PACKAGE__; my $r = shift; return $class->new($r)->default_handler(); 1.4 +1 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm Index: RegistryBB.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RegistryBB.pm 14 Aug 2002 14:27:03 - 1.3 +++ RegistryBB.pm 15 Aug 2002 16:17:52 - 1.4 @@ -10,8 +10,7 @@ use base qw(ModPerl::RegistryCooker); -# META: prototyping ($$) segfaults on request -sub handler { +sub handler : method { my $class = (@_ >= 2) ? shift : __PACKAGE__; my $r = shift; return $class->new($r)->default_handler(); 1.17 +2 -2 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- RegistryCooker.pm 15 Aug 2002 14:26:10 - 1.16 +++ RegistryCooker.pm 15 Aug 2002 16:17:52 - 1.17 @@ -119,10 +119,10 @@ # __PACKAGE__, which is tied to the file) # -sub handler { +sub handler : method { my $class = (@_ >= 2) ? shift : __PACKAGE__; my $r = shift; -$class->new($r)->default_handler(); +return $class->new($r)->default_handler(); } # 1.7 +10 -1 modperl-2.0/ModPerl-Registry/t/basic.t Index: basic.t === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- basic.t 14 Aug 2002 14:27:45 - 1.6 +++ basic.t 15 Aug 2002 16:17:52 - 1.7 @@ -14,7 +14,7 @@ my @aliases = sort keys %modules; -plan tests => @aliases * 3; +plan tests => @aliases * 3 + 1; # very basic compilation/response test for my $alias (@aliases) { @@ -62,3 +62,12 @@ #); #} +# test method handlers +{ +my $url = "/registry_oo_conf/env.pl?foo=bar"; +ok t_cmp( +"foo=bar", +GET_BODY($url), +"ModPerl::Registry->handler mod_cgi-like environment pre-set", +); +} 1.7 +0 -1 modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in Index: extra.conf.in === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- extra.conf.in 2 Jun 2002 12:58:35 - 1.6 +++ extra.conf.in 15 Aug 2002 16:17:52 - 1.7 @@ -53,7 +53,6 @@ PerlOptions +ParseHeaders -# META: dumps core on OO handlers PerlOptions +GlobalRequest SetHandler perl-script
cvs commit: modperl-2.0/t/api .cvsignore
stas2002/08/15 20:19:44 Modified:t/apache .cvsignore t/api.cvsignore Added: t/compat .cvsignore Log: .cvsignore updates Revision ChangesPath 1.1 modperl-2.0/t/compat/.cvsignore Index: .cvsignore === apache.t apache_file.t apache_table.t apache_util.t request.t 1.5 +0 -2 modperl-2.0/t/apache/.cvsignore Index: .cvsignore === RCS file: /home/cvs/modperl-2.0/t/apache/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- .cvsignore25 Jan 2002 08:17:58 - 1.4 +++ .cvsignore16 Aug 2002 03:19:44 - 1.5 @@ -1,6 +1,4 @@ cgihandler.t -compat.t -compat2.t conftree.t constants.t post.t 1.4 +0 -1 modperl-2.0/t/api/.cvsignore Index: .cvsignore === RCS file: /home/cvs/modperl-2.0/t/api/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- .cvsignore4 Dec 2001 22:44:29 - 1.3 +++ .cvsignore16 Aug 2002 03:19:44 - 1.4 @@ -8,7 +8,6 @@ response.t r_subclass.t rutil.t -send_fd.t sendfile.t server_rec.t server_util.t
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm Registry.pm PerlRun.pm
stas2002/08/15 23:58:25 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Registry.pm PerlRun.pm Log: use ModPerl::ROOT:: symbol table for the common root of compiled packages, but child nodes diverge into different subtrees by the driving package Revision ChangesPath 1.18 +3 -9 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- RegistryCooker.pm 15 Aug 2002 16:17:52 - 1.17 +++ RegistryCooker.pm 16 Aug 2002 06:58:25 - 1.18 @@ -235,21 +235,15 @@ } # # func: namespace_root -# dflt: namespace_root_common +# dflt: namespace_root # desc: define the namespace root for storing compiled scripts # args: $self - registry blessed object # rtrn: the namespace root # -*namespace_root = \&namespace_root_common; - -sub namespace_root_common { -'ModPerl::RegistryROOT'; -} - -sub namespace_root_local { +sub namespace_root { my $self = shift; -join '::', ref($self), 'ROOT'; +join '::', 'ModPerl::ROOT', ref($self), } # 1.6 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Registry.pm 15 Aug 2002 16:17:52 - 1.5 +++ Registry.pm 16 Aug 2002 06:58:25 - 1.6 @@ -28,7 +28,7 @@ run => 'run', can_compile => 'can_compile', make_namespace => 'make_namespace', -namespace_root => 'namespace_root_common', +namespace_root => 'namespace_root', namespace_from => 'namespace_from_filename', is_cached => 'is_cached', should_compile => 'should_compile_if_modified', 1.5 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm Index: PerlRun.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/PerlRun.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PerlRun.pm15 Aug 2002 16:17:52 - 1.4 +++ PerlRun.pm16 Aug 2002 06:58:25 - 1.5 @@ -28,7 +28,7 @@ run => 'run', can_compile => 'can_compile', make_namespace => 'make_namespace', -namespace_root => 'namespace_root_common', +namespace_root => 'namespace_root', namespace_from => 'namespace_from_filename', is_cached => 'FALSE', should_compile => 'TRUE',
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/15 23:59:02 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: fix the notes() setting, which was broken Revision ChangesPath 1.19 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- RegistryCooker.pm 16 Aug 2002 06:58:25 - 1.18 +++ RegistryCooker.pm 16 Aug 2002 06:59:02 - 1.19 @@ -697,7 +697,7 @@ my $class = ref $self; $self->[REQ]->log_error("$$: $class: $msg"); -$self->[REQ]->notes('error-notes', $msg); +$self->[REQ]->notes->set('error-notes' => $msg); $@{$self->[URI]} = $msg; }
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/15 23:59:52 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: a nicer way to call a code ref Revision ChangesPath 1.20 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- RegistryCooker.pm 16 Aug 2002 06:59:02 - 1.19 +++ RegistryCooker.pm 16 Aug 2002 06:59:51 - 1.20 @@ -176,7 +176,7 @@ { # run the code and preserve warnings setup when it's done no warnings; -eval { $rc = &{$cv}($r, @_) }; +eval { $rc = $cv->($r, @_) }; $self->[STATUS] = $rc; ModPerl::Global::special_list_call(END => $package); }
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas2002/08/16 00:07:38 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: a typo fix Revision ChangesPath 1.21 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- RegistryCooker.pm 16 Aug 2002 06:59:51 - 1.20 +++ RegistryCooker.pm 16 Aug 2002 07:07:38 - 1.21 @@ -243,7 +243,7 @@ sub namespace_root { my $self = shift; -join '::', 'ModPerl::ROOT', ref($self), +join '::', 'ModPerl::ROOT', ref($self); } #
cvs commit: modperl-2.0/ModPerl-Registry/t/conf modperl_extra_startup.pl
stas2002/08/16 01:01:18 Modified:ModPerl-Registry/lib/ModPerl RegistryLoader.pm ModPerl-Registry/t/cgi-bin special_blocks.pl ModPerl-Registry/t/conf modperl_extra_startup.pl Log: ModPerl::RegistryLoader is now fully operational and tested Revision ChangesPath 1.2 +29 -13modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm Index: RegistryLoader.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RegistryLoader.pm 13 Nov 2001 04:33:06 - 1.1 +++ RegistryLoader.pm 16 Aug 2002 08:01:18 - 1.2 @@ -1,11 +1,15 @@ package ModPerl::RegistryLoader; -use Apache::Const -compile => qw(OPT_EXECCGI); +use Apache::Process; + +use Apache::Const -compile => qw(OK HTTP_OK OPT_EXECCGI); use Carp; our @ISA = (); -sub new { +# using create() instead of new() since the latter is inherited from +# the SUPER class, and it's used inside handler() from the SUPER class +sub create { my $class = shift; my $self = bless {@_} => ref($class)||$class; $self->load_package($self->{package}); @@ -31,9 +35,9 @@ } else { # try to translate URI->filename -if (my $func = $self->{trans}) { +if (exists $self->{trans} and ref($self->{trans}) eq 'CODE') { no strict 'refs'; -$filename = $func->($uri); +$filename = $self->{trans}->($uri); unless (-e $filename) { $self->warn("Cannot find a translated from uri: $filename"); return; @@ -41,8 +45,11 @@ } else { # try to guess (my $guess = $uri) =~ s|^/||; -$filename = Apache::server_root_relative($guess); -$self->warn("Trying to guess filename based on uri"); + +$self->warn("Trying to guess filename based on uri") +if $self->{debug}; +my $pool = Apache->server->process->pool; +$filename = Apache::server_root_relative($pool, $guess); unless (-e $filename) { $self->warn("Cannot find guessed file: $filename", "provide \$filename or 'trans' sub"); @@ -55,25 +62,34 @@ $self->warn("*** uri=$uri, filename=$filename"); } -my $r = bless { -uri => $uri, -filename => $filename, - } => ref($self) || $self; +my $rl = bless { +uri => $uri, +filename => $filename, +package => $self->{package}, +} => ref($self) || $self; -$r->SUPER::handler; +__PACKAGE__->SUPER::handler($rl); } sub filename { shift->{filename} } +sub status { Apache::HTTP_OK } sub finfo{ shift->{filename} } sub uri { shift->{uri} } sub path_info {} sub allow_options { Apache::OPT_EXECCGI } #will be checked again at run-time sub log_error { shift; die @_ if $@; warn @_; } *log_reason = \&log_error; -sub run {} # don't run the script +sub run { return Apache::OK } # don't run the script sub server { shift } +# the preloaded file needs to be precompiled into the package +# specified by the 'package' attribute, not RegistryLoader +sub namespace_root { +join '::', 'ModPerl::ROOT', +shift->[ModPerl::RegistryCooker::REQ]->{package}; +} + # override Apache class methods called by Modperl::Registry*. normally # only available at request-time via blessed request_rec pointer sub slurp_filename { @@ -97,7 +113,7 @@ sub warn { my $self = shift; -Apache::warn(__PACKAGE__ . ": @_\n"); +Apache->warn(__PACKAGE__ . ": @_\n"); } 1; 1.4 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl Index: special_blocks.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- special_blocks.pl 14 May 2002 15:47:12 - 1.3 +++ special_blocks.pl 16 Aug 2002 08:01:18 - 1.4 @@ -27,7 +27,7 @@ } END { -if ($test eq 'end') { +if (defined $test && $test eq 'end') { print "end ok"; } } 1.3 +39 -30modperl-2.0/ModPerl-Registry/t/conf/modperl_extra_sta
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm RegistryLoader.pm
stas2002/08/16 01:05:50 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm RegistryLoader.pm Log: introduce the constant ModPerl::RegistryCooker::NAMESPACE_ROOT, so the same root can be re-used in the RegistryLoader Revision ChangesPath 1.22 +4 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- RegistryCooker.pm 16 Aug 2002 07:07:38 - 1.21 +++ RegistryCooker.pm 16 Aug 2002 08:05:50 - 1.22 @@ -76,6 +76,9 @@ use constant FALSE => sub { 0 }; +use constant NAMESPACE_ROOT => 'ModPerl::ROOT'; + + # # func: new # dflt: new @@ -243,7 +246,7 @@ sub namespace_root { my $self = shift; -join '::', 'ModPerl::ROOT', ref($self); +join '::', NAMESPACE_ROOT, ref($self); } # 1.3 +1 -1 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm Index: RegistryLoader.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RegistryLoader.pm 16 Aug 2002 08:01:18 - 1.2 +++ RegistryLoader.pm 16 Aug 2002 08:05:50 - 1.3 @@ -86,7 +86,7 @@ # the preloaded file needs to be precompiled into the package # specified by the 'package' attribute, not RegistryLoader sub namespace_root { -join '::', 'ModPerl::ROOT', +join '::', ModPerl::RegistryCooker::NAMESPACE_ROOT, shift->[ModPerl::RegistryCooker::REQ]->{package}; }
cvs commit: modperl-2.0/ModPerl-Registry/t/conf modperl_extra_startup.pl
stas2002/08/16 02:01:17 Modified:ModPerl-Registry TODO ModPerl-Registry/lib/ModPerl RegistryCooker.pm RegistryLoader.pm ModPerl-Registry/t/conf modperl_extra_startup.pl Log: - getting rid of compat.pm completely, the only two missing functions, which are tmp substituted with my_finfo my_slurp_filename, will be replaced with real function when these are ported. - also make sure that everything is running under 'use strict'. - update TODO Revision ChangesPath 1.9 +5 -1 modperl-2.0/ModPerl-Registry/TODO Index: TODO === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TODO 15 Aug 2002 16:16:24 - 1.8 +++ TODO 16 Aug 2002 09:01:17 - 1.9 @@ -9,13 +9,17 @@ - consider not to use $$ in debug tracing. Not all platforms give out a different pid for different threads. +- some problems with setting the DEBUG() constant based on the value of + Apache->server->dir_config('ModPerl::RegistryCooker::DEBUG') + ### missing features ### - need to port $Apache::__T, to test against when user supplies -T flag. - port Apache::PerlRunXS -- implement slurp_filename and remove Apache::compat +- replace the local implementation of slurp_filename() and finfo(), + when these will be ported to mod_perl 2.0 - $r->chdir_file is not handled/implemented, see todo/api.txt unsafe! 1.23 +34 -10modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- RegistryCooker.pm 16 Aug 2002 08:05:50 - 1.22 +++ RegistryCooker.pm 16 Aug 2002 09:01:17 - 1.23 @@ -15,16 +15,21 @@ our $VERSION = '1.99'; -use Apache::compat (); - use Apache::Response (); use Apache::RequestRec (); -use Apache::Log; -use Apache::Const -compile => qw(:common &OPT_EXECCGI); -use File::Spec::Functions (); +use Apache::RequestIO (); +use Apache::Log (); +use Apache::Access (); + +use APR::Table (); + use ModPerl::Util (); use ModPerl::Global (); +use File::Spec::Functions (); + +use Apache::Const -compile => qw(:common &OPT_EXECCGI); + unless (defined $ModPerl::Registry::MarkLine) { $ModPerl::Registry::MarkLine = 1; } @@ -210,7 +215,7 @@ my $self = shift; my $r = $self->[REQ]; -unless (-r $r->finfo && -s _) { +unless (-r $r->my_finfo && -s _) { $self->log_error("$self->[FILENAME] not found or unable to stat"); return Apache::NOT_FOUND; } @@ -220,13 +225,13 @@ $self->[MTIME] = -M _; unless (-x _ or IS_WIN32) { -$r->log_reason("file permissions deny server execution", +$r->log_error("file permissions deny server execution", $self->[FILENAME]); return Apache::FORBIDDEN; } if (!($r->allow_options & Apache::OPT_EXECCGI)) { -$r->log_reason("Options ExecCGI is off in this directory", +$r->log_error("Options ExecCGI is off in this directory", $self->[FILENAME]); return Apache::FORBIDDEN; } @@ -440,7 +445,7 @@ # wasn't modified sub should_compile_if_modified { my $self = shift; -$self->[MTIME] ||= -M $self->[REQ]->finfo; +$self->[MTIME] ||= -M $self->[REQ]->my_finfo; !($self->is_cached && $self->cache_table->{ $self->[PACKAGE] }{mtime} <= $self->[MTIME]); } @@ -519,7 +524,7 @@ my $self = shift; $self->debug("reading $self->[FILENAME]") if DEBUG & D_NOISE; -$self->[CODE] = $self->[REQ]->slurp_filename; +$self->[CODE] = $self->[REQ]->my_slurp_filename; } # @@ -741,6 +746,25 @@ Apache->warn("$$: cannot find $package in cache"); } } + + +# XXX: these should go away when finfo() and slurp_filename() are +# ported to 2.0 (don't want to depend on compat.pm) +sub Apache::RequestRec::my_finfo { +my $r = shift; +stat $r->filename; +\*_; +} + +sub Apache::RequestRec::my_slurp_filename { +my $r = shift; +open my $fh, $r->filename; +local $/; +my $data = <$
cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin redirect.pl
stas2002/08/16 03:11:17 Added: ModPerl-Registry/t redirect.t ModPerl-Registry/t/cgi-bin redirect.pl Log: test external redirects Revision ChangesPath 1.1 modperl-2.0/ModPerl-Registry/t/redirect.t Index: redirect.t === use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use Apache::TestRequest qw(GET_BODY HEAD); plan tests => 2; my $base_url = "/registry/redirect.pl"; { my $redirect_path = "/registry/basic.pl"; my $url = "$base_url?$redirect_path"; ok t_cmp( "ok", GET_BODY($url), "test redirect: existing target", ); } { my $redirect_path = "/registry/does_not_exists.pl"; my $url = "$base_url?$redirect_path"; ok t_cmp( 404, HEAD($url)->code, "test redirect: non-existing target", ); } 1.1 modperl-2.0/ModPerl-Registry/t/cgi-bin/redirect.pl Index: redirect.pl === # test env vars use Apache::URI (); my $r = shift; my $path = $r->args || ''; $server = $r->construct_server; print "Location: http://$server$path\n\n";; warn "Location: http://$server$path\n\n";; __END__
cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin basic.pl closure.pl env.pl not_executable.pl require.pl special_blocks.pl
stas2002/08/16 03:11:39 Modified:ModPerl-Registry/t/cgi-bin basic.pl closure.pl env.pl not_executable.pl require.pl special_blocks.pl Log: no need for \r\n, \n is just fine Revision ChangesPath 1.2 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/basic.pl Index: basic.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/basic.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- basic.pl 9 Oct 2001 12:47:38 - 1.1 +++ basic.pl 16 Aug 2002 10:11:39 - 1.2 @@ -2,7 +2,7 @@ # test all the basic functionality -print "Content-type: text/plain\r\n\r\n"; +print "Content-type: text/plain\n\n"; print "ok"; __END__ 1.3 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/closure.pl Index: closure.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/closure.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- closure.pl15 Aug 2002 12:21:59 - 1.2 +++ closure.pl16 Aug 2002 10:11:39 - 1.3 @@ -8,7 +8,7 @@ # should see it under ::Registry # should not see it under ::PerlRun -print "Content-type: text/plain\r\n\r\n"; +print "Content-type: text/plain\n\n"; # this is a closure (when compiled inside handler()): my $counter = 0; 1.2 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/env.pl Index: env.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/env.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- env.pl9 Oct 2001 12:47:38 - 1.1 +++ env.pl16 Aug 2002 10:11:39 - 1.2 @@ -1,6 +1,6 @@ # test env vars -print "Content-type: text/plain\r\n\r\n"; +print "Content-type: text/plain\n\n"; print exists $ENV{QUERY_STRING} && $ENV{QUERY_STRING}; __END__ 1.2 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/not_executable.pl Index: not_executable.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/not_executable.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- not_executable.pl 9 Oct 2001 12:47:38 - 1.1 +++ not_executable.pl 16 Aug 2002 10:11:39 - 1.2 @@ -2,7 +2,7 @@ # this test should return forbidden, since it should be not-executable -print "Content-type: text/plain\r\n\r\n"; +print "Content-type: text/plain\n\n"; print "ok"; __END__ 1.3 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl Index: require.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- require.pl14 May 2002 15:53:05 - 1.2 +++ require.pl16 Aug 2002 10:11:39 - 1.3 @@ -1,6 +1,6 @@ # test the require -print "Content-type: text/plain\r\n\r\n"; +print "Content-type: text/plain\n\n"; # XXX: fixme! #use lib qw(.); 1.5 +1 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl Index: special_blocks.pl === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- special_blocks.pl 16 Aug 2002 08:01:18 - 1.4 +++ special_blocks.pl 16 Aug 2002 10:11:39 - 1.5 @@ -10,7 +10,7 @@ $query = $ENV{QUERY_STRING}; } -print "Content-type: text/plain\r\n\r\n"; +print "Content-type: text/plain\n\n"; my $r = shift; our $test = $r->args || '';
cvs commit: modperl-2.0 STATUS
stas2002/08/16 03:15:43 Modified:.STATUS Log: log the fact that PerlPreConnectionHandler is not implemented yet Revision ChangesPath 1.7 +9 -1 modperl-2.0/STATUS Index: STATUS === RCS file: /home/cvs/modperl-2.0/STATUS,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- STATUS15 Aug 2002 15:22:02 - 1.6 +++ STATUS16 Aug 2002 10:15:43 - 1.7 @@ -57,6 +57,14 @@ Open Issues or Core Enhancements: - +* PerlPreConnectionHandler's modperl_callback_pre_connection is not + implemented + + Report: + Status: ??? + + + * Apache::Log compat issues: Apache->warn, Apache::warn, Apache::Server->warn and
cvs commit: modperl-2.0 Changes
stas2002/08/16 03:22:39 Modified:.Changes Log: log recent changes Revision ChangesPath 1.33 +11 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- Changes 15 Aug 2002 15:25:04 - 1.32 +++ Changes 16 Aug 2002 10:22:39 - 1.33 @@ -10,6 +10,14 @@ =item 1.99_05-dev +add external redirects Registry tests [Stas Bekman] + +get rid of the compat layer in ModPerl-Registry [Stas Bekman] + +ModPerl::RegistryLoader is now fully operational and tested [Stas Bekman] + +Registry method handlers are now working [Stas Bekman] + core Registry packages all compile the scripts into ModPerl::RegistryROOT:: namespace and cache them in %ModPerl::RegistryCache. Both overridable by the sub-classes. [Stas Bekman] @@ -28,6 +36,9 @@ [Yair Lenga <[EMAIL PROTECTED]>] - set error-notes on error [Geoff Young <[EMAIL PROTECTED]>] - preserve status in Registry scripts [Geoff Young <[EMAIL PROTECTED]>] + +apr_table_t is now an opaque type, use apr_table_elts() to get the array +record [Stas Bekman] =item 1.99_04 - June 21, 2002
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/08/20 21:44:14 Modified:xs/APR/PerlIO apr_perlio.c Log: improve errors handling add extended debugging trace Revision ChangesPath 1.21 +34 -11modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- apr_perlio.c 5 Jul 2002 05:05:36 - 1.20 +++ apr_perlio.c 21 Aug 2002 04:44:14 - 1.21 @@ -268,13 +268,20 @@ #ifdef PERLIO_APR_DEBUG const char *new_path = NULL; +apr_os_file_t os_file; + if (!PL_dirty) { /* if this is called during perl_destruct we are in trouble */ apr_file_name_get(&new_path, st->file); } -Perl_warn(aTHX_ "PerlIOAPR_close obj=0x%lx, file=0x%lx, name=%s\n", - (unsigned long)f, (unsigned long)st->file, +rc = apr_os_file_get(&os_file, st->file); +if (rc != APR_SUCCESS) { +Perl_croak(aTHX_ "filedes retrieval failed!"); +} + +Perl_warn(aTHX_ "PerlIOAPR_close obj=0x%lx, file=0x%lx, fd=%d, name=%s\n", + (unsigned long)f, (unsigned long)st->file, os_file, new_path ? new_path : "(UNKNOWN)"); #endif @@ -415,9 +422,11 @@ { char *mode; const char *layers = ":APR"; +PerlIOAPR *st; PerlIO *f = PerlIO_allocate(aTHX); + if (!f) { -return NULL; +Perl_croak(aTHX_ "Failed to allocate PerlIO struct"); } switch (type) { @@ -430,19 +439,33 @@ }; PerlIO_apply_layers(aTHX_ f, mode, layers); +if (!f) { +Perl_croak(aTHX_ "Failed to apply the ':APR' layer"); +} -if (f) { -PerlIOAPR *st = PerlIOSelf(f, PerlIOAPR); +st = PerlIOSelf(f, PerlIOAPR); -/* XXX: should we dup first? the timeout could close the fh! */ -st->pool = pool; -st->file = file; -PerlIOBase(f)->flags |= PERLIO_F_OPEN; +#ifdef PERLIO_APR_DEBUG +{ +apr_status_t rc; +apr_os_file_t os_file; -return f; +/* convert to the OS representation of file */ +rc = apr_os_file_get(&os_file, file); +if (rc != APR_SUCCESS) { +croak("filedes retrieval failed!"); +} + +Perl_warn(aTHX_ "converting to PerlIO fd %d, mode '%s'\n", + os_file, mode); } +#endif + +st->pool = pool; +st->file = file; +PerlIOBase(f)->flags |= PERLIO_F_OPEN; -return NULL; +return f; } static SV *apr_perlio_PerlIO_to_glob(pTHX_ PerlIO *pio, apr_perlio_hook_e type)
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/08/20 21:46:44 Modified:xs/APR/PerlIO apr_perlio.c Log: - IoIFP(io) *must* be always set on the valid io sv, otherwise it'll be never closed and fh and memory leaked. as i saw from doio.c, the solution is to simply copy IoOFP. - add IoTYPE_WRONLY and IoTYPE_RDONLY flags to protect from wrong use Revision ChangesPath 1.22 +5 -1 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- apr_perlio.c 21 Aug 2002 04:44:14 - 1.21 +++ apr_perlio.c 21 Aug 2002 04:46:44 - 1.22 @@ -478,11 +478,15 @@ switch (type) { case APR_PERLIO_HOOK_WRITE: -IoOFP(GvIOp(gv)) = pio; + /* if IoIFP() is not assigned to it'll be never closed, see + * Perl_io_close() */ +IoIFP(GvIOp(gv)) = IoOFP(GvIOp(gv)) = pio; IoFLAGS(GvIOp(gv)) |= IOf_FLUSH; +IoTYPE(GvIOp(gv)) = IoTYPE_WRONLY; break; case APR_PERLIO_HOOK_READ: IoIFP(GvIOp(gv)) = pio; +IoTYPE(GvIOp(gv)) = IoTYPE_RDONLY; break; };
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/08/21 08:40:17 Modified:xs/APR/PerlIO apr_perlio.c Log: - try to go without the dup() in the non-perlio case, leave enough comments to easily reconstruct the dupping code correctly if that proves to be wrong. - add some debug tracing code Revision ChangesPath 1.23 +24 -7 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- apr_perlio.c 21 Aug 2002 04:46:44 - 1.22 +++ apr_perlio.c 21 Aug 2002 15:40:17 - 1.23 @@ -525,15 +525,32 @@ /* convert to the OS representation of file */ rc = apr_os_file_get(&os_file, file); if (rc != APR_SUCCESS) { -croak("filedes retrieval failed!"); +Perl_croak(aTHX_ "filedes retrieval failed!"); } - -fd = PerlLIO_dup(os_file); -/* Perl_warn(aTHX_ "fd old: %d, new %d\n", os_file, fd); */ - -if (!(retval = PerlIO_fdopen(fd, mode))) { + +#ifdef PERLIO_APR_DEBUG +Perl_warn(aTHX_ "converting fd %d\n", os_file); +#endif + +/* let's try without the dup, it seems to work fine: + + fd = PerlLIO_dup(os_file); + Perl_warn(aTHX_ "fd old: %d, new %d\n", os_file, fd); + if (!(retval = PerlIO_fdopen(fd, mode))) { + ... + } + + in any case if we later decide to dup, remember to: + + apr_file_close(file); + + after PerlIO_fdopen() or that fh will be leaked + +*/ + +if (!(retval = PerlIO_fdopen(os_file, mode))) { PerlLIO_close(fd); -croak("fdopen failed!"); +Perl_croak(aTHX_ "fdopen failed!"); } return retval;
cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
stas2002/08/21 08:41:29 Modified:xs/APR/PerlIO apr_perlio.c Log: similar to the perlio case: - IoIFP(io) *must* be always set on the valid io sv, otherwise it'll be never closed and fh and memory leaked. as i saw from doio.c, the solution is to simply copy IoOFP. - add IoTYPE_WRONLY and IoTYPE_RDONLY flags to protect from wrong use Revision ChangesPath 1.24 +4 -1 modperl-2.0/xs/APR/PerlIO/apr_perlio.c Index: apr_perlio.c === RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- apr_perlio.c 21 Aug 2002 15:40:17 - 1.23 +++ apr_perlio.c 21 Aug 2002 15:41:29 - 1.24 @@ -567,11 +567,14 @@ switch (type) { case APR_PERLIO_HOOK_WRITE: -IoOFP(GvIOp(gv)) = apr_perlio_apr_file_to_FILE(aTHX_ file, type); +IoIFP(GvIOp(gv)) = IoOFP(GvIOp(gv)) = +apr_perlio_apr_file_to_FILE(aTHX_ file, type); IoFLAGS(GvIOp(gv)) |= IOf_FLUSH; +IoTYPE(GvIOp(gv)) = IoTYPE_WRONLY; break; case APR_PERLIO_HOOK_READ: IoIFP(GvIOp(gv)) = apr_perlio_apr_file_to_FILE(aTHX_ file, type); +IoTYPE(GvIOp(gv)) = IoTYPE_RDONLY; break; };
cvs commit: modperl-2.0/t/response/TestApache subprocess.pm
stas2002/08/21 08:43:39 Modified:t/response/TestApache subprocess.pm Log: by doing select() for the non-perlio case finally made this test working with non-perlio perl builds, including 5.6.0. Revision ChangesPath 1.10 +52 -14modperl-2.0/t/response/TestApache/subprocess.pm Index: subprocess.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/subprocess.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- subprocess.pm 12 May 2002 19:40:19 - 1.9 +++ subprocess.pm 21 Aug 2002 15:43:39 - 1.10 @@ -7,9 +7,13 @@ use Apache::TestUtil; use File::Spec::Functions qw(catfile catdir); +use IO::Select (); use Apache::Const -compile => 'OK'; +use Config; +use constant PERLIO_IS_ENABLED => $Config{useperlio}; + my %scripts = ( argv => 'print STDOUT "@ARGV";', env=> 'print STDOUT $ENV{SubProcess}', @@ -36,10 +40,7 @@ my $cfg = Apache::Test::config(); my $vars = $cfg->{vars}; -# XXX: these tests randomly fail under 5.6.1 -plan $r, tests => 4, -have {"perl < 5.7.3" => sub { $] >= 5.007003 } }, - qw(APR::PerlIO Apache::SubProcess); +plan $r, tests => 4, have qw(APR::PerlIO Apache::SubProcess); eval { require Apache::SubProcess }; @@ -49,9 +50,10 @@ # test: passing argv + scalar context my $command = catfile $target_dir, "argv.pl"; my @argv = qw(foo bar); -my $out = Apache::SubProcess::spawn_proc_prog($r, $command, \@argv); +my $out_fh = Apache::SubProcess::spawn_proc_prog($r, $command, \@argv); +my $output = read_data($out_fh); ok t_cmp(\@argv, - [split / /, <$out>], + [split / /, $output], "passing ARGV" ); } @@ -61,9 +63,10 @@ my $command = catfile $target_dir, "env.pl"; my $value = "my cool proc"; $r->subprocess_env->set(SubProcess => $value); -my $out = Apache::SubProcess::spawn_proc_prog($r, $command); +my $out_fh = Apache::SubProcess::spawn_proc_prog($r, $command); +my $output = read_data($out_fh); ok t_cmp($value, - scalar(<$out>), + $output, "passing env via subprocess_env" ); } @@ -72,11 +75,12 @@ # test: subproc's stdin -> stdout + list context my $command = catfile $target_dir, "in_out.pl"; my $value = "my cool proc\n"; # must have \n for -my ($in, $out, $err) = +my ($in_fh, $out_fh, $err_fh) = Apache::SubProcess::spawn_proc_prog($r, $command); -print $in $value; +print $in_fh $value; +my $output = read_data($out_fh); ok t_cmp($value, - scalar(<$out>), + $output, "testing subproc's stdin -> stdout + list context" ); } @@ -85,11 +89,12 @@ # test: subproc's stdin -> stderr + list context my $command = catfile $target_dir, "in_err.pl"; my $value = "my stderr\n"; # must have \n for -my ($in, $out, $err) = +my ($in_fh, $out_fh, $err_fh) = Apache::SubProcess::spawn_proc_prog($r, $command); -print $in $value; +print $in_fh $value; +my $output = read_data($err_fh); ok t_cmp($value, - scalar(<$err>), + $output, "testing subproc's stdin -> stderr + list context" ); } @@ -119,6 +124,39 @@ Apache::OK; } + + +sub read_data { +my($fh) = @_; +my @data = (); +my $sel = IO::Select->new($fh); + +# here is the catch: +# +# non-PerlIO pipe fh needs to select if the other end is not fast +# enough to send the data, since the read is non-blocking +# +# PerlIO-based pipe fh on the other hand does the select +# internally via apr_wait_for_io_or_timeout() in +# apr_file_read(). But you cannot call select() on the +# PerlIO-based, because its fileno() returns (-1), remember that +# apr_file_t is an opaque object, and on certain platforms +# fileno() is different from unix +# +# so we use the following wrapper: if we are under perlio we just +# go ahead and read the data, if we are under non-perlio we first +# select for a few secs.
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
stas2002/08/21 10:25:10 Modified:xs/Apache/Connection Apache__Connection.h xs/tables/current/ModPerl FunctionTable.pm Log: fix the incorrect return type for get_remote_host s/char */const char */ Revision ChangesPath 1.5 +1 -1 modperl-2.0/xs/Apache/Connection/Apache__Connection.h Index: Apache__Connection.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Connection/Apache__Connection.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Apache__Connection.h 15 Aug 2002 08:42:55 - 1.4 +++ Apache__Connection.h 21 Aug 2002 17:25:10 - 1.5 @@ -13,7 +13,7 @@ } static MP_INLINE -char *mpxs_Apache__Connection_get_remote_host(pTHX_ conn_rec *c, +const char *mpxs_Apache__Connection_get_remote_host(pTHX_ conn_rec *c, int type, apr_table_t *dir_config) { 1.77 +1 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- FunctionTable.pm 15 Aug 2002 08:42:55 - 1.76 +++ FunctionTable.pm 21 Aug 2002 17:25:10 - 1.77 @@ -4305,7 +4305,7 @@ ] }, { -'return_type' => 'char *', +'return_type' => 'const char *', 'name' => 'mpxs_Apache__Connection_get_remote_host', 'args' => [ {
cvs commit: modperl-2.0 Changes
stas2002/08/21 10:33:57 Modified:.Changes Log: document recent changes Revision ChangesPath 1.39 +14 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- Changes 21 Aug 2002 16:42:01 - 1.38 +++ Changes 21 Aug 2002 17:33:56 - 1.39 @@ -10,6 +10,20 @@ =item 1.99_06-dev +fix compilation probs with get_remote_host() that had a wrong +prototype [Stas Bekman] + +Apache::SubProcess now has a manpage [Stas Bekman] + +fix the Apache::SubProcess tests to work with perlio-disabled Perl +[Stas Bekman] + +fix the filehandle leak in APR::PerlIO (both perlio-disabled and +perlio-enabled Perl) [Stas Bekman] + +remove dup() when converting filehandles from apr_file_t to FILE* +under perlio-disabled Perl (APR::PerlIO) [Stas Bekman] + fix compilation if apache/apr do not have thread support =item 1.99_05 - August 20, 2002
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
stas2002/08/27 19:24:48 Modified:xs/APR/Bucket APR__Bucket.h xs/maps apr_functions.map xs/tables/current/ModPerl FunctionTable.pm Log: add the APR::Bucket::is_flush glue function Revision ChangesPath 1.5 +5 -0 modperl-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.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- APR__Bucket.h 30 May 2002 02:33:48 - 1.4 +++ APR__Bucket.h 28 Aug 2002 02:24:47 - 1.5 @@ -44,6 +44,11 @@ return APR_BUCKET_IS_EOS(bucket); } +static MP_INLINE int mpxs_APR__Bucket_is_flush(apr_bucket *bucket) +{ +return APR_BUCKET_IS_FLUSH(bucket); +} + static MP_INLINE void mpxs_APR__Bucket_insert_before(apr_bucket *a, apr_bucket *b) { 1.46 +1 -0 modperl-2.0/xs/maps/apr_functions.map Index: apr_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- apr_functions.map 23 Jun 2002 22:00:03 - 1.45 +++ apr_functions.map 28 Aug 2002 02:24:47 - 1.46 @@ -102,6 +102,7 @@ mpxs_APR__Brigade_empty#APR_BRIGADE_EMPTY MODULE=APR::Bucket + mpxs_APR__Bucket_is_flush #APR_BUCKET_IS_FLUSH 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 1.83 +15 -27modperl-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.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- FunctionTable.pm 27 Aug 2002 04:28:48 - 1.82 +++ FunctionTable.pm 28 Aug 2002 02:24:47 - 1.83 @@ -2,7 +2,7 @@ # !! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Mon Aug 26 19:47:54 2002 +# ! Wed Aug 28 10:12:34 2002 # ! do NOT edit, any changes will be lost ! # !! @@ -4343,6 +4343,20 @@ ] }, { +'return_type' => 'int', +'name' => 'mpxs_APR__Bucket_is_flush', +'attr' => [ + 'static', + '__inline__' +], +'args' => [ + { +'type' => 'apr_bucket *', +'name' => 'bucket' + } +] + }, + { 'return_type' => 'apr_bucket *', 'name' => 'mpxs_APR__Bucket_new', 'attr' => [ @@ -5507,32 +5521,6 @@ { 'type' => 'SV *', 'name' => 'arg' - } -] - }, - { -'return_type' => 'apr_global_mutex_t *', -'name' => 'mpxs_apr_global_mutex_create', -'args' => [ - { -'type' => 'PerlInterpreter *', -'name' => 'my_perl' - }, - { -'type' => 'SV *', -'name' => 'classname' - }, - { -'type' => 'apr_pool_t *', -'name' => 'pool' - }, - { -'type' => 'const char *', -'name' => 'fname' - }, - { -'type' => 'apr_lockmech_e', -'name' => 'mech' } ] },