Geoffrey Young wrote:

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).

Can you please remind me what was the mp1 behavior on that? We need to match it. Things are complicated in mp2, because the C environ struct is detached from perl's %ENV, so there is a lot of extra work to do to think %ENV and $r->subprocess_env


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;
+

This is ain't right, as it ignores the user's setting of whether to load env vars or not via:


PerlOptions [+-]SetupEnv and SetHandler (modperl|perl-script)

http://perl.apache.org/docs/2.0/user/config/config.html#C_SetupEnv_
http://perl.apache.org/docs/2.0/user/config/config.html#C_SetHandler_

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to