]> git.kaiwu.me - nginx.git/commit
Stream: relaxed next upstream condition (ticket #1317).
authorRoman Arutyunyan <arut@nginx.com>
Mon, 11 Sep 2017 12:32:31 +0000 (15:32 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Mon, 11 Sep 2017 12:32:31 +0000 (15:32 +0300)
commit1602ae60e4294a8be7c5677c6026fdf1c9ceb880
tree173537501cec7dfc8d4229792dcf204e5cd19e1f
parentd80e485863d76a869c6efd6985452d3ff68f3f17
Stream: relaxed next upstream condition (ticket #1317).

When switching to a next upstream, some buffers could be stuck in the middle
of the filter chain.  A condition existed that raised an error when this
happened.  As it turned out, this condition prevented switching to a next
upstream if ssl preread was used with the TCP protocol (see the ticket).

In fact, the condition does not make sense for TCP, since after successful
connection to an upstream switching to another upstream never happens.  As for
UDP, the issue with stuck buffers is unlikely to happen, but is still possible.
Specifically, if a filter delays sending data to upstream.

The condition can be relaxed to only check the "buffered" bitmask of the
upstream connection.  The new condition is simpler and fixes the ticket issue
as well.  Additionally, the upstream_out chain is now reset for UDP prior to
connecting to a new upstream to prevent repeating the client data twice.
src/stream/ngx_stream_proxy_module.c