Skip to content

Commit b53e9a7

Browse files
committed
undo rebased-over change
1 parent 49d678c commit b53e9a7

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

lib/net/http/persistent.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,13 +651,23 @@ def connection_for uri
651651

652652
return yield connection
653653
rescue Errno::ECONNREFUSED
654-
address = http.proxy_address || http.address
655-
port = http.proxy_port || http.port
654+
if http.proxy?
655+
address = http.proxy_address
656+
port = http.proxy_port
657+
else
658+
address = http.address
659+
port = http.port
660+
end
656661

657662
raise Error, "connection refused: #{address}:#{port}"
658663
rescue Errno::EHOSTDOWN
659-
address = http.proxy_address || http.address
660-
port = http.proxy_port || http.port
664+
if http.proxy?
665+
address = http.proxy_address
666+
port = http.proxy_port
667+
else
668+
address = http.address
669+
port = http.port
670+
end
661671

662672
raise Error, "host down: #{address}:#{port}"
663673
ensure

0 commit comments

Comments
 (0)