I'm sorry to say this did not fix the problem - bit I have managed to
hack up some of the code to get it to unset the environment.  I really
didn't know what I was doing so there is probably a better way (and I
don't really know the internals of mod_perl so I may have screwed other
things up)...but here is my attempt at an explanation.

Your change was made to modperl_env_request_populate which is called
from the response handler (modperl_response_handler and
modperl_response_handler_cgi) which I assume would be to process dynamic
pages.  Since this request is on a standard html page
modperl_env_request_populate was not getting called.  

Instead it was using modperl_env_configure_request_dir (this was the one
setting my particular variable, however it is possible that
modperl_env_configure_request_srv could have same issue).  I applied
your same modperl_config_req_cleanup_register to those two functions and
that still did not solve the problem (left these changes in the
functions but may not be needed?).  

So I tried working backwords figuring out where the environemnt gets
unset (modperl_env_request_unpopulate) and the call to that in
modperl_config.c is wrapped in if(MpReqSETUP_ENV) which never gets set
when just calling env_conf...dir and env_conf...srv.  

My solution was to change the if logic to include MpReqPERL_SET_ENV_DIR
and MpReqPERL_SET_ENV_SRV when calling modperl_env_request_unpopulate.  

Final snag was that inside modperl_env_request_unpopulate there is
another check to MpReqSETUP_ENV - so before I called
modperl_env_request_unpopulate I set MpReqSETUP_ENV_On.

Brian

-----Original Message-----
From: Geoffrey Young [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 21, 2005 8:38 AM
To: Brian Becker
Cc: modperl@perl.apache.org
Subject: Re: [mp2] PerlSetEnv Issue

ugh, another message lost to the email-eating tree...

reposting.


> What am I missing?

that there was a bug?  :)

ok, here's what I think is going on.  we only register the %ENV cleanup
function when a Perl*Handler runs for a given request but in your case
that
doesn't happen by design, so %ENV is set up but never cleaned up and
%ENV
propagates forever.

I think this patch ought to do the trick.  the only problem is that I
can't
seem to reproduce your bug in our test environment, probably because
there
is _always_ some mod_perl handler running in the base config, even if I
create a separate virtual host.  nevertheless, give it a whirl and
report
back if it seems to fix your issue.

oh, and sorry for the slow turnaround and overall silence :)

--Geoff



Reply via email to