diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2016-12-07 19:03:19 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2016-12-07 19:03:19 +0300 |
commit | 408e49fed64873aa5b7c3affb2a227e15ccee025 (patch) | |
tree | 5b4da70a4153c85a6b9ed4ec01b0f8cc1ae10696 /src/core/nginx.c | |
parent | fcb2e2864e0c7a245daef1fc11ffedf6598f21df (diff) | |
download | nginx-408e49fed64873aa5b7c3affb2a227e15ccee025.tar.gz nginx-408e49fed64873aa5b7c3affb2a227e15ccee025.zip |
Perl: added PERL_SET_INTERP().
For Perl compiled with threads, without PERL_SET_INTERP() the PL_curinterp
remains set to the first interpreter created (that is, one created at
original start). As a result after a reload Perl thinks that operations
are done withing a thread, and, most notably, denies to change environment.
For example, the following code properly works on original start,
but fails after a reload:
perl 'sub {
my $r = shift;
$r->send_http_header("text/plain");
$ENV{TZ} = "UTC";
$r->print("tz: " . $ENV{TZ} . " (localtime " . (localtime()) . ")\n");
$ENV{TZ} = "Europe/Moscow";
$r->print("tz: " . $ENV{TZ} . " (localtime " . (localtime()) . ")\n");
return OK;
}';
To fix this, PERL_SET_INTERP() added anywhere where PERL_SET_CONTEXT()
was previously used.
Note that PERL_SET_INTERP() doesn't seem to be documented anywhere.
Yet it is used in some other software, and also seems to be the only
solution possible.
Diffstat (limited to 'src/core/nginx.c')
0 files changed, 0 insertions, 0 deletions