mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
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;
39 lines
1.0 KiB
Plaintext
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
|