Skip to content

Commit

Permalink
undo rebased-over change
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfaulkner committed Dec 4, 2024
1 parent 49d678c commit b53e9a7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions lib/net/http/persistent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,23 @@ def connection_for uri

return yield connection
rescue Errno::ECONNREFUSED
address = http.proxy_address || http.address
port = http.proxy_port || http.port
if http.proxy?
address = http.proxy_address
port = http.proxy_port
else
address = http.address
port = http.port
end

raise Error, "connection refused: #{address}:#{port}"
rescue Errno::EHOSTDOWN
address = http.proxy_address || http.address
port = http.proxy_port || http.port
if http.proxy?
address = http.proxy_address
port = http.proxy_port
else
address = http.address
port = http.port
end

raise Error, "host down: #{address}:#{port}"
ensure
Expand Down

0 comments on commit b53e9a7

Please sign in to comment.