cvs commit: modperl/t/net/perl dirty-script.cgi dirty-test.cgi
dougm 00/05/12 00:11:05 Modified:.Changes ToDo lib/Apache PerlRun.pm t/docs startup.pl t/modules perlrun.t t/net/perl dirty-script.cgi dirty-test.cgi Log: Apache::PerlRun::flush_namespace fixes, so aliased (imported) code/hash/array/scalar are undefined without undef-ing the pointed-to data and without using B.pm and: modules/perlrun was never properly run in the first place Revision ChangesPath 1.479 +4 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.478 retrieving revision 1.479 diff -u -r1.478 -r1.479 --- Changes 2000/05/05 08:10:33 1.478 +++ Changes 2000/05/12 07:10:56 1.479 @@ -10,6 +10,10 @@ =item 1.23_01-dev +Apache::PerlRun::flush_namespace fixes, so aliased (imported) +code/hash/array/scalar are undefined without undef-ing the pointed-to +data and without using B.pm, thanks to Richard Chen for the suggestion + document Apache::print's special behavior wrt references [Jeffrey W. Baker <[EMAIL PROTECTED]>] 1.242 +1 -4 modperl/ToDo Index: ToDo === RCS file: /home/cvs/modperl/ToDo,v retrieving revision 1.241 retrieving revision 1.242 diff -u -r1.241 -r1.242 --- ToDo 2000/04/21 17:04:56 1.241 +++ ToDo 2000/05/12 07:10:56 1.242 @@ -52,10 +52,7 @@ - coderef to $r->custom_response [Randal L. Schwartz <[EMAIL PROTECTED]>] -- PerlRun::flush_namespace needs to check if_owner for all types, not -just cvs. NOTE: i dont think this is possible, only CVs have a GV -pointer attached -dougm -[John M Vinopal <[EMAIL PROTECTED]>] +- Apache::PerlRun::flush_namespace should be re-written in c - should $r->content unset $r->headers_in('content-length') ? NOTE: im worried this could break apps who need to know content-length 1.28 +34 -20modperl/lib/Apache/PerlRun.pm Index: PerlRun.pm === RCS file: /home/cvs/modperl/lib/Apache/PerlRun.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- PerlRun.pm2000/04/05 06:19:34 1.27 +++ PerlRun.pm2000/05/12 07:10:57 1.28 @@ -312,36 +312,50 @@ return $rc; } +BEGIN { +if ($] < 5.006) { +$INC{'warnings.pm'} = __FILE__; +*warnings::unimport = sub {}; +} +} + sub flush_namespace { my($self, $package) = @_; $package ||= $self->namespace; -no strict; +no strict 'refs'; my $tab = \%{$package.'::'}; for (keys %$tab) { - if(*{ $tab->{$_} }{CODE}) { - undef_cv_if_owner($package, \&{ $tab->{$_} }); - } -if(*{ $tab->{$_} }{HASH}) { -undef %{ $tab->{$_} }; +my $fullname = join '::', $package, $_; +#code/hash/array/scalar might be imported +#make sure the gv does not point elsewhere +#before undefing each +if (%$fullname) { +*{$fullname} = {}; +undef %$fullname; } -if(*{ $tab->{$_} }{ARRAY}) { -undef @{ $tab->{$_} }; +if (@$fullname) { +*{$fullname} = []; +undef @$fullname; } -if(*{ $tab->{$_} }{SCALAR}) { - undef ${ $tab->{$_} }; +if ($$fullname) { +my $tmp; #argh, no such thing as an anonymous scalar +*{$fullname} = \$tmp; +undef $$fullname; } - } -} - -sub undef_cv_if_owner { -return unless $INC{'B.pm'}; -my($package, $cv) = @_; -my $obj= B::svref_2object($cv); -my $stash = $obj->GV->STASH->NAME; -return unless $package eq $stash; -undef &$cv; +if (defined &$fullname) { +no warnings; +local $^W = 0; +*{$fullname} = sub {}; + undef &$fullname; + } +if (*{$fullname}{IO}) { +if (fileno $fullname) { +close $fullname; +} +} +} } 1; 1.37 +5 -2 modperl/t/docs/startup.pl Index: startup.pl === RCS file: /home/cvs/modperl/t/docs/startup.pl,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- startup.pl1999/04/07 03:34:35 1.36 +++ startup.pl2000/05/12 07:10:58 1.37 @@ -1,4 +1,4 @@ -#! /usr/local/bin/perl +#!perl unless (defined $ENV{MOD_PERL}) { die "\$ENV{MOD_PERL} not set!"; @@ -103,7 +103,10 @@ $ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GAT
cvs commit: modperl/t/net/perl dirty-script.cgi dirty-test.cgi
richter 00/09/12 23:06:53 Modified:.Changes Makefile.PL src/modules/ApacheModulePerl ApacheModulePerl.dsp t/docs startup.pl t/net/perl dirty-script.cgi dirty-test.cgi Added: src/modules/ApacheModulePerl ApacheModulePerl.def Log: Latest patches so mod_perl works now on ActivePerl Revision ChangesPath 1.515 +2 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.514 retrieving revision 1.515 diff -u -r1.514 -r1.515 --- Changes 2000/09/01 21:09:12 1.514 +++ Changes 2000/09/13 06:06:39 1.515 @@ -15,6 +15,8 @@ fixes for ActivePerl [Gurusamy Sarathy <[EMAIL PROTECTED]>] +runs now on ActivePerl [Randy Korbes, Gerald Richter] + change apaci/Makefile.tmpl and src/modules/perl/Makefile so Perl's include path comes before /usr/local/include, e.g. to make sure Perl's patchlevel.h is used, thanks to Ryan Morgan for the spot 1.166 +5 -0 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.165 retrieving revision 1.166 diff -u -r1.165 -r1.166 --- Makefile.PL 2000/09/01 21:09:12 1.165 +++ Makefile.PL 2000/09/13 06:06:40 1.166 @@ -1170,6 +1170,11 @@ #DIR => \@DIR, NAME=> "mod_perl", VERSION => $VERSION, +($] < 5.005 ? () : + ( +ABSTRACT => 'Embed a Perl interpreter in the Apache HTTP server', +AUTHOR => 'Doug MacEachern <[EMAIL PROTECTED]>', + )), #should override `CCFLAGS', can't with older perls #CCDLFLAGS => "$Config{ccdlflags} $EXTRA_CFLAGS", DEFINE => $EXTRA_CFLAGS, 1.7 +4 -0 modperl/src/modules/ApacheModulePerl/ApacheModulePerl.dsp Index: ApacheModulePerl.dsp === RCS file: /home/cvs/modperl/src/modules/ApacheModulePerl/ApacheModulePerl.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ApacheModulePerl.dsp 2000/03/05 01:26:57 1.6 +++ ApacheModulePerl.dsp 2000/09/13 06:06:43 1.7 @@ -92,6 +92,10 @@ # End Source File # Begin Source File +SOURCE=.\ApacheModulePerl.def +# End Source File +# Begin Source File + SOURCE=..\..\..\..\..\Apache\ApacheCore.lib # End Source File # Begin Source File 1.1 modperl/src/modules/ApacheModulePerl/ApacheModulePerl.def Index: ApacheModulePerl.def === LIBRARY EXPORTS sv2request_rec perl_request_rec mod_perl_tie_table perl_cmd_perl_FLAG perl_cmd_perl_TAKE2 perl_cmd_perl_TAKE1 perl_cmd_perl_TAKE123 perl_perl_cmd_cleanup 1.38 +3 -1 modperl/t/docs/startup.pl Index: startup.pl === RCS file: /home/cvs/modperl/t/docs/startup.pl,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- startup.pl2000/05/12 07:10:58 1.37 +++ startup.pl2000/09/13 06:06:46 1.38 @@ -11,7 +11,9 @@ use lib map { "$Apache::Server::CWD/$_" } qw(t/docs blib/lib blib/arch); require "blib.pl" if -e "./t/docs/blib.pl"; #Perl ignores w/ -T -unshift @INC, split ":", $ENV{PERL5LIB} if $ENV{PERL5LIB}; +if ($ENV{PERL5LIB} and $ENV{PASS_PERL5LIB}) { + unshift @INC, map { Apache->untaint($_) } split ":", $ENV{PERL5LIB}; +} $Apache::Server::Starting or warn "Server is not starting !?\n"; \$Apache::Server::Starting == \$Apache::ServerStarting or 1.6 +5 -1 modperl/t/net/perl/dirty-script.cgi Index: dirty-script.cgi === RCS file: /home/cvs/modperl/t/net/perl/dirty-script.cgi,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- dirty-script.cgi 2000/05/12 07:10:59 1.5 +++ dirty-script.cgi 2000/09/13 06:06:48 1.6 @@ -1,6 +1,10 @@ local $^W = 0; -use lib '.'; +unshift @INC, + -e "dirty-lib" ? '.' : + Apache->server_root_relative("net/perl"); require "dirty-lib"; +shift @INC; + unless (defined(¬_ina_package) && not_ina_package()) { die "%INC save/restore broken"; } 1.6 +6 -1 modperl/t/net/perl/dirty-test.cgi Index: dirty-test.cgi === RCS file: /home/cvs/modperl/t/net/perl/dirty-test.cgi,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- dirty-test.