Fetch: stop address failover once a response has started
Previously, ngx_js_http_next() reconnected to the next resolved address
after a recv() or send() error at any stage of the exchange, resetting
only http->buffer. If a read error occurred after the first peer had
already sent part of the response, the retry reused the dirty parser and
response state and an already destroyed request chain.
Now address failover is disabled once response bytes have been received
from the peer, and the fetch fails with "prematurely closed connection"
just like on an unexpected EOF. For HTTPS via a forward proxy, the
flag is reset once the CONNECT tunnel is established so origin connect
failures are still handled as before.
The issue was introduced in
73c75e41 (0.5.1).