<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/modules/perl, branch release-1.13.12</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Cleaned up r-&gt;headers_out.headers allocation error handling.</title>
<updated>2017-04-20T15:26:37+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2017-04-20T15:26:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=9ecf8428645579cf66adc5ba939bf1267924c5bc'/>
<id>9ecf8428645579cf66adc5ba939bf1267924c5bc</id>
<content type='text'>
If initialization of a header failed for some reason after ngx_list_push(),
leaving the header as is can result in uninitialized memory access by
the header filter or the log module.  The fix is to clear partially
initialized headers in case of errors.

For the Cache-Control header, the fix is to postpone pushing
r-&gt;headers_out.cache_control until its value is completed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If initialization of a header failed for some reason after ngx_list_push(),
leaving the header as is can result in uninitialized memory access by
the header filter or the log module.  The fix is to clear partially
initialized headers in case of errors.

For the Cache-Control header, the fix is to postpone pushing
r-&gt;headers_out.cache_control until its value is completed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Added support for the "308 Permanent Redirect" (ticket #877).</title>
<updated>2017-04-11T01:13:46+00:00</updated>
<author>
<name>Simon Leblanc</name>
<email>contact@leblanc-simon.eu</email>
</author>
<published>2017-04-11T01:13:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=8ee2de5e9c930273c99a03452e7336f8a393ec42'/>
<id>8ee2de5e9c930273c99a03452e7336f8a393ec42</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<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>
</feed>
