diff --git a/lib/httpx/resolver/native.rb b/lib/httpx/resolver/native.rb index 40aa5c98..606cbbc1 100644 --- a/lib/httpx/resolver/native.rb +++ b/lib/httpx/resolver/native.rb @@ -318,7 +318,7 @@ module HTTPX return end else - @timeouts.delete(name) + reset_hostname(name, connection: connection) @timeouts.delete(connection.origin.host) @connections.delete(connection) Resolver.cached_lookup_set(connection.origin.host, @family, addresses) if @resolver_options[:cache] @@ -429,9 +429,8 @@ module HTTPX end end - def reset_hostname(hostname, reset_candidates: true) + def reset_hostname(hostname, connection: @queries.delete(hostname), reset_candidates: true) @timeouts.delete(hostname) - connection = @queries.delete(hostname) @timeouts.delete(hostname) return unless connection && reset_candidates diff --git a/sig/resolver/native.rbs b/sig/resolver/native.rbs index 7796c84c..2a41ccca 100644 --- a/sig/resolver/native.rbs +++ b/sig/resolver/native.rbs @@ -63,7 +63,7 @@ module HTTPX def handle_error: (NativeResolveError | StandardError) -> void - def reset_hostname: (String hostname, ?reset_candidates: bool) -> void + def reset_hostname: (String hostname, ?connection: Connection, ?reset_candidates: bool) -> void end end end \ No newline at end of file