perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2.0] Win32 ENV still not compatible with mod_cgi
Date Sun, 11 May 2003 06:30:37 GMT
Joe Schaefer wrote:

> It appears mod_perl2 treats %ENV as a perl hash instead
> of a (tied) apr_table (which ARE case-sensitive). 
> 
> IMO that's a bug in modperl2: the offending file is 
> modperl_env.c, which populates a perl hash from 
> r->process_env instead of tying an APR::Table
> to it.  Anyone know why we're doing that?

Because environ is not thread-local. See the comments in modperl_env.c line 219.

/*
  * XXX: what we do here might change:
  *      - make it optional for %ENV to be tied to r->subprocess_env
  *      - make it possible to modify environ
  *      - we could allow modification of environ if mpm isn't threaded
  *      - we could allow modification of environ if variable isn't a CGI
  *        variable (still could cause problems)
  */
/*
  * problems we are trying to solve:
  *      - environ is shared between threads
  *          + Perl does not serialize access to environ
  *          + even if it did, CGI variables cannot be shared between threads!
  * problems we create by trying to solve above problems:
  *      - a forked process will not inherit the current %ENV
  *      - C libraries might rely on environ, e.g. DBD::Oracle
  */
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message