licence_audit/httpc_adaptive
Keep this client until a replacement provides a bounded IPv6 probe and
remembers IPv4 fallback for the rest of the command. These are required
behaviors, not redundant wrappers around gleam_httpc.
An IPv6-only DNS nxdomain selects IPv4 silently; other probe failures warn.
#43 fixed repeated IPv6 timeouts. Removing this client in #61 brought them
back: gleam_httpc’s inet6fb4 path can exhaust the five-second Hex timeout
before IPv4 succeeds. The same endpoint responds promptly over IPv4.
Types
pub type Error {
InvalidUtf8Response
ResponseTimeout
NoIpv6Address
FailedToConnect(reason: String)
RequestFailed(reason: String)
}
Constructors
-
InvalidUtf8Response -
ResponseTimeout -
NoIpv6Address -
FailedToConnect(reason: String) -
RequestFailed(reason: String)
Values
pub fn dispatch(
request: request.Request(String),
timeout_ms timeout_ms: Int,
) -> Result(response.Response(String), Error)
pub fn dispatch_bits(
request: request.Request(BitArray),
timeout_ms timeout_ms: Int,
) -> Result(response.Response(BitArray), Error)
pub fn dispatch_bits_with(
request: request.Request(BitArray),
timeout_ms: Int,
client: fn(request.Request(BitArray), Int, IpFamily) -> Result(
response.Response(BitArray),
Error,
),
) -> Result(response.Response(BitArray), Error)
Inject the transport so fallback behavior can be tested without network I/O.
pub fn select_family(
request: request.Request(BitArray),
client: fn(request.Request(BitArray), Int, IpFamily) -> Result(
response.Response(BitArray),
Error,
),
) -> IpFamily
Reuse the command’s family selection with a bounded transport for the probe.
pub fn take_warning() -> option.Option(String)