<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/modules/perl/ngx_http_perl_module.h, branch release-1.29.3</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Perl: expect escaped URIs in $r-&gt;internal_redirect().</title>
<updated>2019-07-12T12:39:26+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T12:39:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=8df08b02b89c151e4bf04bc3c7c9a37e9ebcba9d'/>
<id>8df08b02b89c151e4bf04bc3c7c9a37e9ebcba9d</id>
<content type='text'>
Similarly to the change in 5491:74bfa803a5aa (1.5.9), we should accept
properly escaped URIs and unescape them as needed, else it is not possible
to handle URIs with question marks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similarly to the change in 5491:74bfa803a5aa (1.5.9), we should accept
properly escaped URIs and unescape them as needed, else it is not possible
to handle URIs with question marks.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: avoid returning 500 if header was already sent.</title>
<updated>2019-07-12T12:39:25+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T12:39:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=78b39bd631fc18fd5778090183776f5275005e21'/>
<id>78b39bd631fc18fd5778090183776f5275005e21</id>
<content type='text'>
Returning NGX_HTTP_INTERNAL_SERVER_ERROR if a perl code died after
sending header will lead to a "header already sent" alert.  To avoid
it, we now check if header was already sent, and return NGX_ERROR
instead if it was.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returning NGX_HTTP_INTERNAL_SERVER_ERROR if a perl code died after
sending header will lead to a "header already sent" alert.  To avoid
it, we now check if header was already sent, and return NGX_ERROR
instead if it was.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: disabled unrelated calls from variable handlers.</title>
<updated>2019-07-12T12:35:31+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T12:35:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=cae2e689083a04b2ddbb93bef5313b136080df65'/>
<id>cae2e689083a04b2ddbb93bef5313b136080df65</id>
<content type='text'>
Variable handlers are not expected to send anything to the client, cannot
sleep or read body, and are not expected to modify the request.  Added
appropriate protection to prevent accidental foot shooting.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Variable handlers are not expected to send anything to the client, cannot
sleep or read body, and are not expected to modify the request.  Added
appropriate protection to prevent accidental foot shooting.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: propagate errors.</title>
<updated>2019-07-12T10:56:21+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T10:56:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=4a0771f9a62eccf168e651a502e67ec17d1cd6c7'/>
<id>4a0771f9a62eccf168e651a502e67ec17d1cd6c7</id>
<content type='text'>
When an error happens, the ctx-&gt;error bit is now set, and croak()
is called to terminate further processing.  The ctx-&gt;error bit is
checked in ngx_http_perl_call_handler() to cancel further processing,
and is also checked in various output functions - to make sure these won't
be called if croak() was handled by an eval{} in perl code.

In particular, this ensures that output chain won't be called after
errors, as filters might not expect this to happen.  This fixes some
segmentation faults under low memory conditions.  Also this stops
request processing after filter finalization or request body reading
errors.

For cases where an HTTP error status can be additionally returned (for
example, 416 (Requested Range Not Satisfiable) from the range filter),
the ctx-&gt;status field is also added.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When an error happens, the ctx-&gt;error bit is now set, and croak()
is called to terminate further processing.  The ctx-&gt;error bit is
checked in ngx_http_perl_call_handler() to cancel further processing,
and is also checked in various output functions - to make sure these won't
be called if croak() was handled by an eval{} in perl code.

In particular, this ensures that output chain won't be called after
errors, as filters might not expect this to happen.  This fixes some
segmentation faults under low memory conditions.  Also this stops
request processing after filter finalization or request body reading
errors.

For cases where an HTTP error status can be additionally returned (for
example, 416 (Requested Range Not Satisfiable) from the range filter),
the ctx-&gt;status field is also added.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: reworked perl module to pass ctx instead of request.</title>
<updated>2019-07-12T08:29:22+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T08:29:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=eae5e4dd01dfaff9d15c3dd7818f082e2995cc74'/>
<id>eae5e4dd01dfaff9d15c3dd7818f082e2995cc74</id>
<content type='text'>
This ensures that correct ctx is always available, including after
filter finalization.  In particular, this fixes a segmentation fault
with the following configuration:

    location / {
        image_filter test;

        perl 'sub {
            my $r = shift;
            $r-&gt;send_http_header();
            $r-&gt;print("foo\n");
            $r-&gt;print("bar\n");
        }';
    }

This also seems to be the only way to correctly handle filter finalization
in various complex cases, for example, when embedded perl is used both
in the original handler and in an error page called after filter
finalization.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This ensures that correct ctx is always available, including after
filter finalization.  In particular, this fixes a segmentation fault
with the following configuration:

    location / {
        image_filter test;

        perl 'sub {
            my $r = shift;
            $r-&gt;send_http_header();
            $r-&gt;print("foo\n");
            $r-&gt;print("bar\n");
        }';
    }

This also seems to be the only way to correctly handle filter finalization
in various complex cases, for example, when embedded perl is used both
in the original handler and in an error page called after filter
finalization.
</pre>
</div>
</content>
</entry>
<entry>
<title>Copyright updated.</title>
<updated>2012-01-18T15:07:43+00:00</updated>
<author>
<name>Maxim Konovalov</name>
<email>maxim@nginx.com</email>
</author>
<published>2012-01-18T15:07:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=f8d59e33f34185c28d1d3c6625a897e214b7ca73'/>
<id>f8d59e33f34185c28d1d3c6625a897e214b7ca73</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>optimize $r-&gt;sleep</title>
<updated>2008-02-16T14:23:14+00:00</updated>
<author>
<name>Igor Sysoev</name>
<email>igor@sysoev.ru</email>
</author>
<published>2008-02-16T14:23:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=0a0c02f58b477257dd3e7e7f62274e5671b88e8e'/>
<id>0a0c02f58b477257dd3e7e7f62274e5671b88e8e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>$r-&gt;variable() supports perl only variables</title>
<updated>2006-12-12T22:06:03+00:00</updated>
<author>
<name>Igor Sysoev</name>
<email>igor@sysoev.ru</email>
</author>
<published>2006-12-12T22:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=65b8a197b9bef89d8002b03471a0fd236ea84eda'/>
<id>65b8a197b9bef89d8002b03471a0fd236ea84eda</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>$r-&gt;sleep()</title>
<updated>2006-12-12T20:59:24+00:00</updated>
<author>
<name>Igor Sysoev</name>
<email>igor@sysoev.ru</email>
</author>
<published>2006-12-12T20:59:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=e773324c3013cd9c0336db2f346f760d6c3a95cb'/>
<id>e773324c3013cd9c0336db2f346f760d6c3a95cb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Axe several perl interpreter instances: they may be useful in currently</title>
<updated>2006-11-26T14:35:27+00:00</updated>
<author>
<name>Igor Sysoev</name>
<email>igor@sysoev.ru</email>
</author>
<published>2006-11-26T14:35:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=f9b7db5aaa366852f0c58111ac1a1ddfdee8210e'/>
<id>f9b7db5aaa366852f0c58111ac1a1ddfdee8210e</id>
<content type='text'>
unsupported threaded environment, but now they complicate code:
*) perl_clone() requires at least duplicating nginx stash;
*) the multiplicity requires to re-evalute all precompiled subroutines
   and nginx stash in new interpreter context.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unsupported threaded environment, but now they complicate code:
*) perl_clone() requires at least duplicating nginx stash;
*) the multiplicity requires to re-evalute all precompiled subroutines
   and nginx stash in new interpreter context.
</pre>
</div>
</content>
</entry>
</feed>
