Enrico Sorcinelli wrote:
> Hi all,
>
> I've this strange (for me) behaviour (Apache 2.0.48/mod_perl 1.9912).
>
> In MP2 (Registry scripts and handlers) I cannot retrieve, directly from %ENV,
> the additional environvment variables that I pushed with $r->subprocess_env
> method (for example in a Translation or HeaderParser phase).
I know stas was working on this for a while and had a few issues with how it
was handled...
the exchange between the subprocess_env table and %ENV only happens once
per-request. to me, it looks like this once is on the first Perl*Handler
callback. for the most part, I think this is ok, since handlers always have
access to $r->subprocess_env anyway. but for Registry I guess it's problematic.
so, try this (untested) patch and see if it helps.
>
> I attached a little tar.gz package with complete scripts, MP handlers, and
> Apache conf (MP 1 & 2) files I used in order to easily reproduce my tests.
this is great! however, I'd suggest you use the bug skeletons we provde so
that all we need to do is run 'make test'
http://perl.apache.org/~geoff/bug-reporting-skeleton-mp2.tar.gz
http://perl.apache.org/~geoff/bug-reporting-skeleton-mp1.tar.gz
http://perl.apache.org/docs/2.0/user/help/help.html#Problem_Description
but you're definitely going in the right direction :)
--Geoff
Index: xs/Apache/RequestRec/Apache__RequestRec.h
===================================================================
RCS file: /home/cvspublic/modperl-2.0/xs/Apache/RequestRec/Apache__RequestRec.h,v
retrieving revision 1.8
diff -u -r1.8 Apache__RequestRec.h
--- xs/Apache/RequestRec/Apache__RequestRec.h 14 Jan 2004 21:27:41 -0000 1.8
+++ xs/Apache/RequestRec/Apache__RequestRec.h 28 Jan 2004 14:43:34 -0000
@@ -47,6 +47,8 @@
char *key, SV *val)
{
if (GIMME_V == G_VOID) {
+ MP_dRCFG;
+ MpReqSETUP_ENV_Off(rcfg);
modperl_env_request_populate(aTHX_ r);
}
Index: ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
retrieving revision 1.41
diff -u -r1.41 RegistryCooker.pm
--- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm 25 Jan 2004 01:04:16 -0000
1.41
+++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm 28 Jan 2004 14:43:34 -0000
@@ -180,6 +180,9 @@
%orig_inc = %INC;
}
+ # make sure that registry scripts can see all of subprocess_env in %ENV
+ $r->subprocess_env;
+
{ # run the code and preserve warnings setup when it's done
no warnings;
eval { $cv->($r, @_) };
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]