From b53e9a79a5cc1bf909aa0cf0900a96bf0a403996 Mon Sep 17 00:00:00 2001 From: "S. Brent Faulkner" Date: Wed, 4 Dec 2024 18:55:01 -0500 Subject: [PATCH] undo rebased-over change --- lib/net/http/persistent.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/net/http/persistent.rb b/lib/net/http/persistent.rb index c0b5553..de19192 100644 --- a/lib/net/http/persistent.rb +++ b/lib/net/http/persistent.rb @@ -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