<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/modules/perl, branch release-1.11.11</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Perl: added PERL_SET_INTERP().</title>
<updated>2016-12-07T16:03:19+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2016-12-07T16:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=408e49fed64873aa5b7c3affb2a227e15ccee025'/>
<id>408e49fed64873aa5b7c3affb2a227e15ccee025</id>
<content type='text'>
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-&gt;send_http_header("text/plain");

        $ENV{TZ} = "UTC";
        $r-&gt;print("tz: " . $ENV{TZ} . " (localtime " . (localtime()) . ")\n");
        $ENV{TZ} = "Europe/Moscow";
        $r-&gt;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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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-&gt;send_http_header("text/plain");

        $ENV{TZ} = "UTC";
        $r-&gt;print("tz: " . $ENV{TZ} . " (localtime " . (localtime()) . ")\n");
        $ENV{TZ} = "Europe/Moscow";
        $r-&gt;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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: fixed optimization in SSI command handler.</title>
<updated>2016-11-01T17:39:21+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2016-11-01T17:39:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=0438b6049855c4f20e4c13c719badacd19308a5c'/>
<id>0438b6049855c4f20e4c13c719badacd19308a5c</id>
<content type='text'>
As the pointer to the first argument was tested instead of the argument
itself, array of arguments was always created, even if there were no
arguments.  Fix is to test args[0] instead of args.

Found by Coverity (CID 1356862).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the pointer to the first argument was tested instead of the argument
itself, array of arguments was always created, even if there were no
arguments.  Fix is to test args[0] instead of args.

Found by Coverity (CID 1356862).
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: pass additional linker options to perl module.</title>
<updated>2016-09-20T19:11:23+00:00</updated>
<author>
<name>Konstantin Pavlov</name>
<email>thresh@nginx.com</email>
</author>
<published>2016-09-20T19:11:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=c8526aca2529ee0095afc3016a2f4106a9aeefdf'/>
<id>c8526aca2529ee0095afc3016a2f4106a9aeefdf</id>
<content type='text'>
Previously flags passed by --with-ld-opt were not used when building perl
module, which meant hardening flags provided by package build systems were not
applied.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously flags passed by --with-ld-opt were not used when building perl
module, which meant hardening flags provided by package build systems were not
applied.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: prototyping behavior explicitly specified.</title>
<updated>2015-08-18T13:26:18+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2015-08-18T13:26:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=2e004237c52b6281514571714bf0ba0b23452846'/>
<id>2e004237c52b6281514571714bf0ba0b23452846</id>
<content type='text'>
When prototyping behavior is not explicitly specified, xsubpp emits
a message to stderr asking to do so (see ticket #608).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When prototyping behavior is not explicitly specified, xsubpp emits
a message to stderr asking to do so (see ticket #608).
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: fixed warning about "sep" may be used uninitialized.</title>
<updated>2015-08-18T13:26:05+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2015-08-18T13:26:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=a0aea61b50e90adf94b713cef4b789f932107107'/>
<id>a0aea61b50e90adf94b713cef4b789f932107107</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: NULL-terminate argument list.</title>
<updated>2014-06-19T11:16:36+00:00</updated>
<author>
<name>Piotr Sikora</name>
<email>piotr@cloudflare.com</email>
</author>
<published>2014-06-19T11:16:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=b3066b16e1d6f7e9c27cc092b67591262d3a8b13'/>
<id>b3066b16e1d6f7e9c27cc092b67591262d3a8b13</id>
<content type='text'>
perl_parse() function expects argv/argc-style argument list,
which according to the C standard must be NULL-terminated,
that is: argv[argc] == NULL.

This change fixes a crash (SIGSEGV) that could happen because
of the buffer overrun during perl module initialization.

Signed-off-by: Piotr Sikora &lt;piotr@cloudflare.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
perl_parse() function expects argv/argc-style argument list,
which according to the C standard must be NULL-terminated,
that is: argv[argc] == NULL.

This change fixes a crash (SIGSEGV) that could happen because
of the buffer overrun during perl module initialization.

Signed-off-by: Piotr Sikora &lt;piotr@cloudflare.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Handling of ngx_int_t != intptr_t case.</title>
<updated>2013-09-04T17:16:59+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2013-09-04T17:16:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=2b0dba578fed500c1955979a8e281f4fad53bad9'/>
<id>2b0dba578fed500c1955979a8e281f4fad53bad9</id>
<content type='text'>
Casts between pointers and integers produce warnings on size mismatch.  To
silence them, cast to (u)intptr_t should be used.  Prevoiusly, casts to
ngx_(u)int_t were used in some cases, and several ngx_int_t expressions had
no casts.

As of now it's mostly style as ngx_int_t is defined as intptr_t.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Casts between pointers and integers produce warnings on size mismatch.  To
silence them, cast to (u)intptr_t should be used.  Prevoiusly, casts to
ngx_(u)int_t were used in some cases, and several ngx_int_t expressions had
no casts.

As of now it's mostly style as ngx_int_t is defined as intptr_t.
</pre>
</div>
</content>
</entry>
<entry>
<title>Backed out f1a91825730a and 7094bd12c1ff.</title>
<updated>2013-08-20T17:11:19+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2013-08-20T17:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=e3cab7675801d224d1d5cdbe7f7b76bbaed97c91'/>
<id>e3cab7675801d224d1d5cdbe7f7b76bbaed97c91</id>
<content type='text'>
While ngx_get_full_name() might have a bit more descriptive arguments,
the ngx_conf_full_name() is generally easier to use when parsing
configuration and limits exposure of cycle-&gt;prefix / cycle-&gt;conf_prefix
details.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While ngx_get_full_name() might have a bit more descriptive arguments,
the ngx_conf_full_name() is generally easier to use when parsing
configuration and limits exposure of cycle-&gt;prefix / cycle-&gt;conf_prefix
details.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replaced ngx_conf_full_name() with ngx_get_full_name().</title>
<updated>2013-08-06T15:58:40+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2013-08-06T15:58:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=d29d21bade3a0fbe0e2d5d7e0e5546873c2ee588'/>
<id>d29d21bade3a0fbe0e2d5d7e0e5546873c2ee588</id>
<content type='text'>
The ngx_get_full_name() function takes more readable arguments list.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ngx_get_full_name() function takes more readable arguments list.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: fixed syntax usage for C preprocessor directives.</title>
<updated>2013-07-29T13:30:01+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2013-07-29T13:30:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=ab1c05272a4078454d6a529bffe6f5918a0c0468'/>
<id>ab1c05272a4078454d6a529bffe6f5918a0c0468</id>
<content type='text'>
As per perlxs, C preprocessor directives should be at the first
non-whitespace of a line to avoid interpreting them as comments.

#if and #endif are moved so that there are no blank lines before them
to retain them as part of the function body.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As per perlxs, C preprocessor directives should be at the first
non-whitespace of a line to avoid interpreting them as comments.

#if and #endif are moved so that there are no blank lines before them
to retain them as part of the function body.
</pre>
</div>
</content>
</entry>
</feed>
