lib/httpx/resolver/resolver.rb in httpx-1.1.0 vs lib/httpx/resolver/resolver.rb in httpx-1.1.1
- old
+ new
@@ -60,11 +60,14 @@
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
- # double emission check
- emit_resolved_connection(connection, addresses) unless connection.addresses && addresses.intersect?(connection.addresses)
+ unless connection.state == :closed ||
+ # double emission check
+ (connection.addresses && addresses.intersect?(connection.addresses))
+ emit_resolved_connection(connection, addresses)
+ end
end
else
emit_resolved_connection(connection, addresses)
end
end