From bbd4a59892e05e691b41e62e1e6064ab3df5c2e8 Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Fri, 12 Sep 2025 09:20:54 +0100 Subject: [PATCH] when addresses from the list expire, always assume that one of them is the current one, and point to the last element of the list (or none) --- lib/httpx/io/tcp.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/httpx/io/tcp.rb b/lib/httpx/io/tcp.rb index 0aac9ba0..1b60749b 100644 --- a/lib/httpx/io/tcp.rb +++ b/lib/httpx/io/tcp.rb @@ -66,9 +66,7 @@ module HTTPX @addresses.delete_if(&:expired?) - unless (decr = prev_addr_size - @addresses.size).zero? - @ip_index = @addresses.size - decr - end + @ip_index = @addresses.size - 1 if prev_addr_size != @addresses.size @addresses.any? end