<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/modules/perl, branch release-1.12.0</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Moved handling of wev-&gt;delayed to the connection event handler.</title>
<updated>2017-04-02T11:32:29+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2017-04-02T11:32:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=5d5f0dcac4e3bbd4464aa1185d7fd51587a3119e'/>
<id>5d5f0dcac4e3bbd4464aa1185d7fd51587a3119e</id>
<content type='text'>
With post_action or subrequests, it is possible that the timer set for
wev-&gt;delayed will expire while the active subrequest write event handler
is not ready to handle this.  This results in request hangs as observed
with limit_rate / sendfile_max_chunk and post_action (ticket #776) or
subrequests (ticket #1228).

Moving the handling to the connection event handler fixes the hangs observed,
and also slightly simplifies the code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With post_action or subrequests, it is possible that the timer set for
wev-&gt;delayed will expire while the active subrequest write event handler
is not ready to handle this.  This results in request hangs as observed
with limit_rate / sendfile_max_chunk and post_action (ticket #776) or
subrequests (ticket #1228).

Moving the handling to the connection event handler fixes the hangs observed,
and also slightly simplifies the code.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: fixed delaying subrequests.</title>
<updated>2017-04-02T11:32:28+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2017-04-02T11:32:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=96e4e84ce273664d0ee43c5c5b7d14efa6f86d39'/>
<id>96e4e84ce273664d0ee43c5c5b7d14efa6f86d39</id>
<content type='text'>
Much like in limit_req, use the wev-&gt;delayed flag to ensure proper handling
and interoperability with limit_rate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Much like in limit_req, use the wev-&gt;delayed flag to ensure proper handling
and interoperability with limit_rate.
</pre>
</div>
</content>
</entry>
<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>
</feed>
