<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/os, branch release-1.23.3</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Win32: event flags handling edge cases in ngx_wsarecv().</title>
<updated>2022-12-01T01:22:36+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-12-01T01:22:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=5eaa67490a43e4f1088b3ebf533559b424f207f1'/>
<id>5eaa67490a43e4f1088b3ebf533559b424f207f1</id>
<content type='text'>
Fixed event flags handling edge cases in ngx_wsarecv() and ngx_wsarecv_chain(),
notably to always reset rev-&gt;ready in case of errors (which wasn't the case
after ngx_socket_nread() errors), and after EOF (rev-&gt;ready was not cleared
if due to a misconfiguration a zero-sized buffer was used for reading).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed event flags handling edge cases in ngx_wsarecv() and ngx_wsarecv_chain(),
notably to always reset rev-&gt;ready in case of errors (which wasn't the case
after ngx_socket_nread() errors), and after EOF (rev-&gt;ready was not cleared
if due to a misconfiguration a zero-sized buffer was used for reading).
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed segfault when switching off master process during upgrade.</title>
<updated>2022-11-23T20:48:53+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-11-23T20:48:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=d52e5684437aedd6bb74d6b2b602b7306f4212ba'/>
<id>d52e5684437aedd6bb74d6b2b602b7306f4212ba</id>
<content type='text'>
Binary upgrades are not supported without master process, but it is,
however, possible, that nginx running with master process is asked
to upgrade binary, and the configuration file as available on disk
at this time includes "master_process off;".

If this happens, listening sockets inherited from the previous binary
will have ls[i].previous set.  But the old cycle on initial process
startup, including startup after binary upgrade, is destroyed by
ngx_init_cycle() once configuration parsing is complete.  As a result,
an attempt to dereference ls[i].previous in ngx_event_process_init()
accesses already freed memory.

Fix is to avoid looking into ls[i].previous if the old cycle is already
freed.

With this change it is also no longer needed to clear ls[i].previous in
worker processes, so the relevant code was removed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Binary upgrades are not supported without master process, but it is,
however, possible, that nginx running with master process is asked
to upgrade binary, and the configuration file as available on disk
at this time includes "master_process off;".

If this happens, listening sockets inherited from the previous binary
will have ls[i].previous set.  But the old cycle on initial process
startup, including startup after binary upgrade, is destroyed by
ngx_init_cycle() once configuration parsing is complete.  As a result,
an attempt to dereference ls[i].previous in ngx_event_process_init()
accesses already freed memory.

Fix is to avoid looking into ls[i].previous if the old cycle is already
freed.

With this change it is also no longer needed to clear ls[i].previous in
worker processes, so the relevant code was removed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Process events posted by ngx_close_idle_connections() immediately.</title>
<updated>2022-11-18T15:31:38+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2022-11-18T15:31:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=17066ac8600412eabb1fdf8360cf6ada13f02391'/>
<id>17066ac8600412eabb1fdf8360cf6ada13f02391</id>
<content type='text'>
Previously, if an event was posted by a read event handler, called by
ngx_close_idle_connections(), that event was not processed until the next
event loop iteration, which could happen after a timeout.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if an event was posted by a read event handler, called by
ngx_close_idle_connections(), that event was not processed until the next
event loop iteration, which could happen after a timeout.
</pre>
</div>
</content>
</entry>
<entry>
<title>Win32: disabled C4306 warnings with MSVC.</title>
<updated>2022-09-06T21:47:07+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-09-06T21:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=90f1b5fd08e9aca01d568d6653da772980033e43'/>
<id>90f1b5fd08e9aca01d568d6653da772980033e43</id>
<content type='text'>
Multiple C4306 warnings (conversion from 'type1' to 'type2' of greater size)
appear during 64-bit compilation with MSVC 2010 (and older) due to extensively
used constructs like "(void *) -1", so they were disabled.

In newer MSVC versions C4306 warnings were replaced with C4312 ones, and
these are not generated for such trivial type casts.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Multiple C4306 warnings (conversion from 'type1' to 'type2' of greater size)
appear during 64-bit compilation with MSVC 2010 (and older) due to extensively
used constructs like "(void *) -1", so they were disabled.

In newer MSVC versions C4306 warnings were replaced with C4312 ones, and
these are not generated for such trivial type casts.
</pre>
</div>
</content>
</entry>
<entry>
<title>Win32: removed misleading comment about warnings being disabled.</title>
<updated>2022-09-06T21:47:02+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-09-06T21:47:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=a3016da23f1f05961c77cae05b9731931d01ebe4'/>
<id>a3016da23f1f05961c77cae05b9731931d01ebe4</id>
<content type='text'>
Warnings being disabled are not only from the "-W4" level since e4590dfd97ff.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Warnings being disabled are not only from the "-W4" level since e4590dfd97ff.
</pre>
</div>
</content>
</entry>
<entry>
<title>Events: fixed EPOLLRDHUP with FIONREAD (ticket #2367).</title>
<updated>2022-07-15T12:19:32+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-07-15T12:19:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=39b84d7a52c2d367d6baba85521c3e7cd0271961'/>
<id>39b84d7a52c2d367d6baba85521c3e7cd0271961</id>
<content type='text'>
When reading exactly rev-&gt;available bytes, rev-&gt;available might become 0
after FIONREAD usage introduction in efd71d49bde0.  On the next call of
ngx_readv_chain() on systems with EPOLLRDHUP this resulted in return without
any actions, that is, with rev-&gt;ready set, and this in turn resulted in no
timers set in event pipe, leading to socket leaks.

Fix is to reset rev-&gt;ready in ngx_readv_chain() when returning due to
rev-&gt;available being 0 with EPOLLRDHUP, much like it is already done in
ngx_unix_recv().  This ensures that if rev-&gt;available will become 0, on
systems with EPOLLRDHUP support appropriate EPOLLRDHUP-specific handling
will happen on the next ngx_readv_chain() call.

While here, also synced ngx_readv_chain() to match ngx_unix_recv() and
reset rev-&gt;ready when returning due to rev-&gt;available being 0 with kqueue.
This is mostly cosmetic change, as rev-&gt;ready is anyway reset when
rev-&gt;available is set to 0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When reading exactly rev-&gt;available bytes, rev-&gt;available might become 0
after FIONREAD usage introduction in efd71d49bde0.  On the next call of
ngx_readv_chain() on systems with EPOLLRDHUP this resulted in return without
any actions, that is, with rev-&gt;ready set, and this in turn resulted in no
timers set in event pipe, leading to socket leaks.

Fix is to reset rev-&gt;ready in ngx_readv_chain() when returning due to
rev-&gt;available being 0 with EPOLLRDHUP, much like it is already done in
ngx_unix_recv().  This ensures that if rev-&gt;available will become 0, on
systems with EPOLLRDHUP support appropriate EPOLLRDHUP-specific handling
will happen on the next ngx_readv_chain() call.

While here, also synced ngx_readv_chain() to match ngx_unix_recv() and
reset rev-&gt;ready when returning due to rev-&gt;available being 0 with kqueue.
This is mostly cosmetic change, as rev-&gt;ready is anyway reset when
rev-&gt;available is set to 0.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed runtime handling of systems without EPOLLRDHUP support.</title>
<updated>2022-05-29T23:38:07+00:00</updated>
<author>
<name>Marcus Ball</name>
<email>marcus.ball@live.com</email>
</author>
<published>2022-05-29T23:38:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=a4eddea7112cf5db86bea5ab9c8dcc597f2a1344'/>
<id>a4eddea7112cf5db86bea5ab9c8dcc597f2a1344</id>
<content type='text'>
In 7583:efd71d49bde0 (nginx 1.17.5) along with introduction of the
ioctl(FIONREAD) support proper handling of systems without EPOLLRDHUP
support in the kernel (but with EPOLLRDHUP in headers) was broken.

Before the change, rev-&gt;available was never set to 0 unless
ngx_use_epoll_rdhup was also set (that is, runtime test for EPOLLRDHUP
introduced in 6536:f7849bfb6d21 succeeded).  After the change,
rev-&gt;available might reach 0 on systems without runtime EPOLLRDHUP
support, stopping further reading in ngx_readv_chain() and ngx_unix_recv().
And, if EOF happened to be already reported along with the last event,
it is not reported again by epoll_wait(), leading to connection hangs
and timeouts on such systems.

This affects Linux kernels before 2.6.17 if nginx was compiled
with newer headers, and, more importantly, emulation layers, such as
DigitalOcean's App Platform's / gVisor's epoll emulation layer.

Fix is to explicitly check ngx_use_epoll_rdhup before the corresponding
rev-&gt;pending_eof tests in ngx_readv_chain() and ngx_unix_recv().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 7583:efd71d49bde0 (nginx 1.17.5) along with introduction of the
ioctl(FIONREAD) support proper handling of systems without EPOLLRDHUP
support in the kernel (but with EPOLLRDHUP in headers) was broken.

Before the change, rev-&gt;available was never set to 0 unless
ngx_use_epoll_rdhup was also set (that is, runtime test for EPOLLRDHUP
introduced in 6536:f7849bfb6d21 succeeded).  After the change,
rev-&gt;available might reach 0 on systems without runtime EPOLLRDHUP
support, stopping further reading in ngx_readv_chain() and ngx_unix_recv().
And, if EOF happened to be already reported along with the last event,
it is not reported again by epoll_wait(), leading to connection hangs
and timeouts on such systems.

This affects Linux kernels before 2.6.17 if nginx was compiled
with newer headers, and, more importantly, emulation layers, such as
DigitalOcean's App Platform's / gVisor's epoll emulation layer.

Fix is to explicitly check ngx_use_epoll_rdhup before the corresponding
rev-&gt;pending_eof tests in ngx_readv_chain() and ngx_unix_recv().
</pre>
</div>
</content>
</entry>
<entry>
<title>Core: added autotest for UDP segmentation offloading.</title>
<updated>2022-01-26T17:40:00+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2022-01-26T17:40:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=05577c18a895d701cb00eef44d758ebf1bd00ddf'/>
<id>05577c18a895d701cb00eef44d758ebf1bd00ddf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Core: added function for local source address cmsg.</title>
<updated>2022-01-25T12:48:58+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2022-01-25T12:48:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=550b40d84faccdb14673bb4091b878d1c2a5b183'/>
<id>550b40d84faccdb14673bb4091b878d1c2a5b183</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Core: made the ngx_sendmsg() function non-static.</title>
<updated>2022-01-25T12:48:56+00:00</updated>
<author>
<name>Vladimir Homutov</name>
<email>vl@nginx.com</email>
</author>
<published>2022-01-25T12:48:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=c67400316626a7375b15dc3068fa8c291e3838d9'/>
<id>c67400316626a7375b15dc3068fa8c291e3838d9</id>
<content type='text'>
The NGX_HAVE_ADDRINFO_CMSG macro is defined when at least one of methods
to deal with corresponding control message is available.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The NGX_HAVE_ADDRINFO_CMSG macro is defined when at least one of methods
to deal with corresponding control message is available.
</pre>
</div>
</content>
</entry>
</feed>
