An official read-only mirror of http://hg.nginx.org/nginx/ which is updated hourly. Pull requests on GitHub cannot be accepted and will be automatically closed. The proper way to submit changes to nginx is via the nginx development mailing list, see http://nginx.org/en/docs/contributing_changes.html
Go to file
Dmitry Volyntsev 433fdbf8b6 Events: improved error event handling for UDP sockets.
Normally, the epoll module calls the read and write handlers depending
on whether EPOLLIN and EPOLLOUT are reported by epoll_wait().  No error
processing is done in the module, the handlers are expected to get an
error when doing I/O.

If an error event is reported without EPOLLIN and EPOLLOUT, the module
set both EPOLLIN and EPOLLOUT to ensure the error event is handled at
least in one active handler.

This works well unless the error is delivered along with only one of
EPOLLIN or EPOLLOUT, and the corresponding handler does not do any I/O.
For example, it happened when getting EPOLLERR|EPOLLOUT from
epoll_wait() upon receiving "ICMP port unreachable" while proxying UDP.
As the write handler had nothing to send it was not able to detect and
log an error, and did not switch to the next upstream.

The fix is to unconditionally set EPOLLIN and EPOLLOUT in case of an
error event.  In the aforementioned case, this causes the read handler
to be called which does recv() and detects an error.

In addition to the epoll module, analogous changes were made in
devpoll/eventport/poll.
2016-11-21 16:03:42 +03:00
auto Configure: honor dependencies of dynamic modules. 2016-11-21 16:49:19 +03:00
conf Added the REQUEST_SCHEME parameter. 2015-06-05 22:23:26 +03:00
contrib Contrib: unicode2nginx compatibility with recent Perl versions. 2016-08-24 15:53:17 +03:00
docs nginx-1.11.6-RELEASE 2016-11-15 18:11:46 +03:00
misc Updated OpenSSL used for win32 builds. 2016-10-11 16:52:48 +03:00
src Events: improved error event handling for UDP sockets. 2016-11-21 16:03:42 +03:00
.hgtags release-1.11.6 tag 2016-11-15 18:11:46 +03:00