perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
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     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message