proxy: allow to recover from IO errors on proxy connection, so that the next one can come along

This commit is contained in:
HoneyryderChuck 2018-06-29 17:23:03 +01:00
parent 8dfbca8fd1
commit 8b5eb7c477

View File

@ -71,7 +71,7 @@ module HTTPX
response = super
if response.is_a?(ErrorResponse) &&
# either it was a timeout error connecting, or it was a proxy error
((response.error.is_a?(TimeoutError) && request.state == :idle) ||
(((response.error.is_a?(TimeoutError) || response.error.is_a?(IOError)) && request.state == :idle) ||
response.error.is_a?(Error)) &&
!@_proxy_uris.empty?
log { "failed connecting to proxy, trying next..." }