Skip to content

Commit

Permalink
dns53/goos: use ctx for reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Jan 24, 2025
1 parent fada457 commit a81d028
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions intra/dns53/goos.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (t *goosr) send(msg *dns.Msg) (ans *dns.Msg, elapsed time.Duration, qerr *d
log.V("dns53: goosr: no-op; host %s is ipaddr", host)
ans, err = xdns.AQuadAForQuery(msg, ip)
} else {
bgctx := context.Background()
aquadaq := xdns.HasAQuadAQuestion(msg)

if !aquadaq { // TODO: support queries other than A/AAAA
Expand All @@ -111,10 +110,10 @@ func (t *goosr) send(msg *dns.Msg) (ans *dns.Msg, elapsed time.Duration, qerr *d
if xdns.HasAAAAQuestion(msg) {
proto = "ip6"
}
if ips, errc := t.rcgo.LookupNetIP(bgctx, proto, host); errc == nil {
if ips, errc := t.rcgo.LookupNetIP(t.ctx, proto, host); errc == nil {
log.D("dns53: goosr: cgo resolver for %s => %s", host, ips)
ans, err = xdns.AQuadAForQuery(msg, ips...)
} else if ips, errl := t.r.LookupNetIP(bgctx, proto, host); errl == nil && xdns.HasAnyAnswer(msg) {
} else if ips, errl := t.r.LookupNetIP(t.ctx, proto, host); errl == nil && xdns.HasAnyAnswer(msg) {
log.D("dns53: goosr: go resolver (why? %v) for %s => %s", errl, host, ips)
ans, err = xdns.AQuadAForQuery(msg, ips...)
} else {
Expand Down

0 comments on commit a81d028

Please sign in to comment.