perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wittkoski" <johnwittko...@aol.com>
Subject [mp1] subprocess_env and non-mod_perl handlers
Date Mon, 03 May 2004 21:33:42 GMT
Greetings all,

So I've been trying to find an answer to this in both the archives and 
in the available mod_perl books, but I have not had any luck, so I was 
hoping someone on the list would know the answer.

Generally: how does subprocess_env in mod_perl 1.x behave with 
non-mod_perl handlers?

It seems from the details I can find that subprocess_env is tied to the 
"live" table of the apache process. However, I am seeing behavior that 
seems to indicate otherwise.

Example 1:

I have mod_perl handlers defined for the TypeHandler and FixupHandler 
phases. If in the TypeHandler code I do this:

$r->subprocess_env("TEST" => "value");

Then in FixupHandler I can "see" TEST using:

$something = $r->subprocess_env("TEST");

Which is what you would expect.


Example 2:

Basically the same except I have a C handler defined for TypeHandler and 
  a mod_perl handler defined for FixupHandler. When the C code does:

ap_table_set(r->subprocess_env, "TEST", "value");

The mod_perl handler for FixupHandler doesn't see it using:

$something = $r->subprocess_env("TEST");


If I do the void subprocess_env trick:

$r->subprocess()

before retrieving $something, then it's populated along with the rest of 
the environment.

However, as mentioned in many of the docs/books, this is expensive and I 
really only need the one variable.

I've also tried walking the subprocess_env table in the perl handler, 
but the value set in the C handler is not there.

Are the C API subprocess_env table and the mod_perl API subprocess_env 
table distict until something (like the void call) merges the tables? Is 
this some sort of scoping issue between C and Perl?


Thanks,

    --John




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message