From 3d437e68f3aae2bb91809a569cf55ddafabfdc12 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Tue, 31 Oct 2023 14:20:56 +0300 Subject: [PATCH] proxy: imp docs --- proxy/dnscontext.go | 5 ++--- proxy/proxy.go | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/proxy/dnscontext.go b/proxy/dnscontext.go index 919f909fa..668622acf 100644 --- a/proxy/dnscontext.go +++ b/proxy/dnscontext.go @@ -63,9 +63,8 @@ type DNSContext struct { // localIP - local IP address (for UDP socket to call udpMakeOOBWithSrc) localIP net.IP - // QueryDuration is the duration of the successful query from an upstream - // DNS server or a fallback DNS server, if exchange with an upstream wasn't - // successful. + // QueryDuration is the duration of a successful query to an upstream + // server or, if the upstream server is unavailable, to a fallback server. QueryDuration time.Duration // DoQVersion is the DoQ protocol version. It can (and should) be read from diff --git a/proxy/proxy.go b/proxy/proxy.go index 3ae3815e0..fe00f910c 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -534,6 +534,10 @@ func (p *Proxy) replyFromUpstream(d *DNSContext) (ok bool, err error) { resp, u, err = upstream.ExchangeParallel(upstreams, req) } + if err != nil { + log.Debug("proxy: replying from %s: %s", src, err) + } + if resp != nil { rtt := time.Since(start) log.Debug("proxy: replying from %s: rtt is %s", src, rtt)