fix(trace): Ensure traces stop when request fails (#175)
All checks were successful
continuous-integration/drone/push Build is passing

Closes #174

Reviewed-on: #175
This commit is contained in:
Sam Therapy 2023-01-31 16:08:07 +00:00
parent 75479f5060
commit 2312fecfc8

View file

@ -64,7 +64,7 @@ func run(args []string) (opts *util.Options, code int, err error) {
for i := 0; i <= opts.Request.Retries; i++ {
resp, err = query.CreateQuery(opts)
if err == nil {
keepTracing = opts.Trace && (!resp.DNS.Authoritative || (opts.Request.Name == "." && tempDomain != "."))
keepTracing = opts.Trace && (!resp.DNS.Authoritative || (opts.Request.Name == "." && tempDomain != ".")) && resp.DNS.MsgHdr.Rcode == 0
break
} else if i != opts.Request.Retries {