lib/httpx/resolver/resolver.rb in httpx-0.19.1 vs lib/httpx/resolver/resolver.rb in httpx-0.19.2
- old
+ new
@@ -47,10 +47,11 @@
def emit_addresses(connection, family, addresses)
addresses.map! do |address|
address.is_a?(IPAddr) ? address : IPAddr.new(address.to_s)
end
log { "resolver: answer #{connection.origin.host}: #{addresses.inspect}" }
- if !connection.io &&
+ if @pool && # if triggered by early resolve, pool may not be here yet
+ !connection.io &&
connection.options.ip_families.size > 1 &&
family == Socket::AF_INET &&
addresses.first.to_s != connection.origin.host.to_s
log { "resolver: A response, applying resolution delay..." }
@pool.after(0.05) do