httpx/sig/resolver/resolver.rbs
HoneyryderChuck a5101870a5 fix for Happy Eyeballs v2 on failed connection
Implemementing the following fixes:

* connections are now marked by IP family of the IO;
* connection "mergeable" status dependent on matching origin when conn
  is already open;
* on a connection error, in case it happened while connection, an event
  is emitted, rather than handling it; if there is another connection
  for the same origin still doing the handshake, the error is ignored;
  if not, the error is handled;
* a new event, `:tcp_open`, is emitted when the tcp socket conn is
  established; this allows for concurrent handshakes to be promptly
  terminated, instead of being dependent on TLS handshake;
* connection cloning now happens early, as connection is set for
  resolving; this way, 2-way callbacks are set as early as possible;
2023-01-21 00:51:03 +00:00

39 lines
1.0 KiB
Plaintext

module HTTPX
module Resolver
class Resolver
include Callbacks
include Loggable
RECORD_TYPES: Hash[Integer, singleton(Resolv::DNS::Resource)]
attr_reader family: ip_family?
@record_type: singleton(Resolv::DNS::Resource)
@options: Options
@resolver_options: Hash[Symbol, untyped]
@queries: Hash[String, Connection]
@system_resolver: Resolv::Hosts
def close: () -> void
def closed?: () -> bool
def empty?: () -> bool
def emit_addresses: (Connection connection, ip_family family, Array[IPAddr]) -> void
private
def emit_resolved_connection: (Connection connection, Array[IPAddr] addresses) -> void
def initialize: (ip_family? family, options options) -> void
def early_resolve: (Connection connection, ?hostname: String) -> void
def emit_resolve_error: (Connection connection, ?String hostname, ?StandardError) -> void
def resolve_error: (String hostname, ?StandardError?) -> ResolveError
end
end
end