http: the client connects through a resolver (step 1 of #71) #525
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 1 of the epic #71 (DNS.md slice 7). The
Clientofstd/httpconnects withTcpStream.connectTo, which uses the system resolver. DNS.md section 7 names the next step after DNS over HTTPS: a client option that resolves through a resolver, which needs one abstraction thatResolver(std/network),TlsResolver(std/tls) andDohResolver(std/http) share. Step 2 of #71 (reading theHTTPSrecord) builds on it.Source
Client...") and slice 7 of the table.Design (decided by the loop)
std/dns(pure, no I/O imports) with the two methods all three resolvers already have,lookup(name, recordType): Task<Result<List<Record>, NetworkError>>andexchange(name, recordType): Task<Result<Message, NetworkError>>. Name follows the naming page and DNS.md (NameResolver);Resolver,TlsResolverandDohResolverimplement it with no signature change, so existing callers compile unchanged.ClientOptions(or the client's existing options type) getsresolver: NameResolver?=None.Nonekeeps today's behaviour (TcpStream.connectTo, system resolver).Some(r): for a name host, the client asksrforAandAAAA, and connects to the first address that accepts, in the order answered; an IP-literal host never asks. The TLS server name stays the host's name.HttpErrorthat carries theNetworkError(HttpError.networkFailure()as inDohResolver); NXDOMAIN or no address is a connection failure, not a fallback to the system resolver.Acceptance criteria
std/dns;Resolver,TlsResolver,DohResolverimplement it; their existing conformance tests (network-lookup,dns-over-tls,dns-over-https) are unchanged and green.resolver: Some(...)connects to a test server on loopback by a name that only the test's name server (written in the test, as innetwork-lookup) answers; the same name fails with the system resolver.HttpErrors carrying theNetworkError(isTimedOut()where the time passed); no hang.--native.docs/standard-library/for http and dns updated,skills/regenerated (--checkgreen).Seed
No:
stdonly, no syntax change, no new native, no compiler lookup by string.Size
One PR, about 1 h, two Conventional Commits:
feat(dns): a trait for the resolvers that share lookup and exchangeandfeat(http): the client connects through a resolver. Gates in forge CI only.Dependencies
None open. Part of #71.
[loop:torbscript] decided by the loop: the trait lives in
std/dnsbecausestd/httpalready depends onstd/dnsandstd/networkcannot importstd/tls; the three resolvers already share the two method signatures, so no breaking change. No fallback to the system resolver on a failed lookup, to keep failures visible. Seed: no. refine: ready, next: implement[loop:torbscript] claim implement by session:loop-torbscript-20261027 until 2026-10-27T08:30Z
[loop:torbscript] implement: PR #527 open (#527), forge CI running, next: wait for CI (expected output of the new conformance test http-client-resolver was written by hand, may need a fix round). Deviation from the decision: the trait
NameResolverlives instd/network, notstd/dns: its methods fail withNetworkError,std/networkimportsstd/dns, sostd/dnsimporting it would be a package cycle (DNS.md section 2). Implementers andstd/httpimport it fromstd/network; behaviour as decided otherwise. Tokens so far: ~120k.PR-Follow-up (Orion, Runbook, 2026-10-27 11:35 Europe/Berlin): PR #527 ist gemergt (merge commit
80170d5c). Der Merge-Commit hat main-CI rot:ci / gates,ci / commit messages,ci / what the change touches,pdisc / pdiscfailure,images / site:edgefailure (Actions run 2000/2002/2001 auf git.torb.dev). Folgecommitda964275auf main: CI noch pending, nicht verifiziert. Logs sind mit dem Orion-Token nicht abrufbar. Diese Task bleibt offen, bis main-CI auf einem Commit mit dem Resolver gruen ist. Nächster Schritt: Worker-Diagnose der main-CI-Fehler.