<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/modules/perl, branch release-1.19.9</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Perl: removed unused variable, forgotten in 975d7ab37b39.</title>
<updated>2019-07-17T14:00:57+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-17T14:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=676d1a0e947c8f39e2606997a3628ec6bdea177d'/>
<id>676d1a0e947c8f39e2606997a3628ec6bdea177d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: named locations in $r-&gt;internal_redirect().</title>
<updated>2019-07-12T12:39:28+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T12:39:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=29fea7d9ec7b18d9f3c2e77bddd873dafbd10842'/>
<id>29fea7d9ec7b18d9f3c2e77bddd873dafbd10842</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<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: additional ctx-&gt;header_sent checks.</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=9e883a2e48ff8e55fcfb091284b44d8fa66fc007'/>
<id>9e883a2e48ff8e55fcfb091284b44d8fa66fc007</id>
<content type='text'>
As we now have ctx-&gt;header_sent flag, it is further used to prevent
duplicate $r-&gt;send_http_header() calls, prevent output before sending
header, and $r-&gt;internal_redirect() after sending header.

Further, $r-&gt;send_http_header() protected from calls after
$r-&gt;internal_redirect().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As we now have ctx-&gt;header_sent flag, it is further used to prevent
duplicate $r-&gt;send_http_header() calls, prevent output before sending
header, and $r-&gt;internal_redirect() after sending header.

Further, $r-&gt;send_http_header() protected from calls after
$r-&gt;internal_redirect().
</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: avoid redirects on errors.</title>
<updated>2019-07-12T12:38:27+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T12:38:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=12d6b3b4a1d024bd8098e20b43b0b7020e5286e6'/>
<id>12d6b3b4a1d024bd8098e20b43b0b7020e5286e6</id>
<content type='text'>
Previously, redirects scheduled with $r-&gt;internal_redirect() were followed
even if the code then died.  Now these are ignored and nginx will return
an error instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, redirects scheduled with $r-&gt;internal_redirect() were followed
even if the code then died.  Now these are ignored and nginx will return
an error instead.
</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: protection against duplicate $r-&gt;sleep() calls.</title>
<updated>2019-07-12T12:34:37+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T12:34:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=19887831698e18149a45a8b9563e8fdcdaaea211'/>
<id>19887831698e18149a45a8b9563e8fdcdaaea211</id>
<content type='text'>
Duplicate $r-&gt;sleep() and/or $r-&gt;has_request_body() calls result
in undefined behaviour (in practice, connection leaks were observed).
To prevent this, croak() added in appropriate places.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Duplicate $r-&gt;sleep() and/or $r-&gt;has_request_body() calls result
in undefined behaviour (in practice, connection leaks were observed).
To prevent this, croak() added in appropriate places.
</pre>
</div>
</content>
</entry>
<entry>
<title>Perl: handling of allocation errors.</title>
<updated>2019-07-12T10:56:23+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2019-07-12T10:56:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=9d266efbc0c1170215397ae669165911b5a828d6'/>
<id>9d266efbc0c1170215397ae669165911b5a828d6</id>
<content type='text'>
Previously, allocation errors in nginx.xs were more or less ignored,
potentially resulting in incorrect code execution in specific low-memory
conditions.  This is changed to use ctx-&gt;error bit and croak(), similarly
to how output errors are now handled.

Note that this is mostly a cosmetic change, as Perl itself exits on memory
allocation errors, and hence nginx with Perl is hardly usable in low-memory
conditions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, allocation errors in nginx.xs were more or less ignored,
potentially resulting in incorrect code execution in specific low-memory
conditions.  This is changed to use ctx-&gt;error bit and croak(), similarly
to how output errors are now handled.

Note that this is mostly a cosmetic change, as Perl itself exits on memory
allocation errors, and hence nginx with Perl is hardly usable in low-memory
conditions.
</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>
</feed>
