stas 2003/10/16 11:23:30
Modified: src/modules/perl mod_perl.c
. Changes
Added: t/response/TestPerl api.pm
Log:
perl 5.8.1 w/ ithreads has a bug where it reports the wrong parent pid
(as the process was never forked), provide a local workaround (+ new
test).
Revision Changes Path
1.190 +9 -0 modperl-2.0/src/modules/perl/mod_perl.c
Index: mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -u -r1.189 -r1.190
--- mod_perl.c 14 Oct 2003 02:33:08 -0000 1.189
+++ mod_perl.c 16 Oct 2003 18:23:30 -0000 1.190
@@ -695,6 +695,15 @@
{
modperl_perl_init_ids_server(s);
+#if PERL_REVISION == 5 && PERL_VERSION == 8 && PERL_SUBVERSION == 1 && \
+ defined(THREADS_HAVE_PIDS)
+ {
+ MP_dSCFG(s);
+ dTHXa(scfg->mip->parent->perl);
+ PL_ppid = (IV)getppid();
+ }
+#endif
+
apr_pool_cleanup_register(p, (void *)s, modperl_child_exit,
apr_pool_cleanup_null);
}
1.1 modperl-2.0/t/response/TestPerl/api.pm
Index: api.pm
===================================================================
package TestPerl::api;
# some perl APIs that we need to test that they work alright under mod_perl
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestTrace;
use Apache::Const -compile => 'OK';
sub handler {
my $r = shift;
plan $r, tests => 1;
{
# 5.8.1 w/ ithreads has a bug where it caches ppid in PL_ppid,
# but updates the record only if perl's fork is called, which
# is not the case with mod_perl. This results in getppid()
# returning 1. A local workaround in the mod_perl source at
# the child_init phase fixes the problem.
my $ppid = getppid();
t_debug "ppid $ppid (pid $$)";
ok $ppid > 1;
}
Apache::OK;
}
1;
1.238 +4 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.237
retrieving revision 1.238
diff -u -u -r1.237 -r1.238
--- Changes 15 Oct 2003 01:29:07 -0000 1.237
+++ Changes 16 Oct 2003 18:23:30 -0000 1.238
@@ -12,6 +12,10 @@
=item 1.99_11-dev -
+perl 5.8.1 w/ ithreads has a bug where it reports the wrong parent pid
+(as the process was never forked), provide a local workaround (+ new
+test). [Stas]
+
overriden STD* streams now can be further overriden and will be
properly restored, which allows functions like $r->internal_redirect
work (+add tests) [Stas]