fix for multi-hostname resolution with aliases failing

context of the multiple alias hops was cleaned up from the context,
which broke next query access.
This commit is contained in:
HoneyryderChuck 2023-06-29 17:48:59 +01:00
parent 255fc98d44
commit ee6c5b231f
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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