mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 22:36:53 +00:00
fix: remove automatic retry when doh fails
This commit is contained in:
parent
e9de332163
commit
c8c18a4651
@ -93,8 +93,6 @@ func dohLookup(domain string) (string, error) {
|
|||||||
|
|
||||||
dnsUpstream := util.GetConfig().DnsAddr
|
dnsUpstream := util.GetConfig().DnsAddr
|
||||||
client := GetDoHClient(*dnsUpstream)
|
client := GetDoHClient(*dnsUpstream)
|
||||||
// try up to 3 times
|
|
||||||
for i := 0; i < 3; i++ {
|
|
||||||
resp, err := client.Resolve(ctx, domain, []uint16{dns.TypeA, dns.TypeAAAA})
|
resp, err := client.Resolve(ctx, domain, []uint16{dns.TypeA, dns.TypeAAAA})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if len(resp) == 0 { // yes this happens
|
if len(resp) == 0 { // yes this happens
|
||||||
@ -103,7 +101,6 @@ func dohLookup(domain string) (string, error) {
|
|||||||
|
|
||||||
return resp[0], nil
|
return resp[0], nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return "", errors.New("could not resolve the domain(doh)")
|
return "", errors.New("could not resolve the domain(doh)")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user