mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-09-11 00:00:36 -04:00
bugfix: do not resolve connection which are already resolved
connections which either already contain addresses, or were given an open IO object, should be marked as resolved, and should not go through the resolver.
This commit is contained in:
parent
e8ac876443
commit
108837e25e
@ -85,6 +85,20 @@ module HTTPX
|
||||
|
||||
def resolve_connection(connection)
|
||||
@connections << connection unless @connections.include?(connection)
|
||||
|
||||
if connection.addresses || connection.state == :open
|
||||
#
|
||||
# there are two cases in which we want to activate initialization of
|
||||
# connection immediately:
|
||||
#
|
||||
# 1. when the connection already has addresses, i.e. it doesn't need to
|
||||
# resolve a name (not the same as name being an IP, yet)
|
||||
# 2. when the connection is initialized with an external already open IO.
|
||||
#
|
||||
on_resolver_connection(connection)
|
||||
return
|
||||
end
|
||||
|
||||
resolver = find_resolver_for(connection)
|
||||
resolver << connection
|
||||
return if resolver.empty?
|
||||
|
Loading…
x
Reference in New Issue
Block a user