Fix: use the fastest whether the result is successful

This commit is contained in:
Dreamacro
2020-02-14 16:36:20 +08:00
parent 6641bf7c07
commit 8b5e511426
5 changed files with 30 additions and 63 deletions

View File

@ -39,7 +39,8 @@ func withFakeIP(fakePool *fakeip.Pool) middleware {
msg.Answer = []D.RR{rr}
setMsgTTL(msg, 1)
msg.SetReply(r)
msg.SetRcode(r, msg.Rcode)
msg.Authoritative = true
w.WriteMsg(msg)
return
}
@ -55,7 +56,8 @@ func withResolver(resolver *Resolver) handler {
D.HandleFailed(w, r)
return
}
msg.SetReply(r)
msg.SetRcode(r, msg.Rcode)
msg.Authoritative = true
w.WriteMsg(msg)
return
}