optimize: remove rush-answer detector because it does always work in all districts

This commit is contained in:
mzz2017
2023-03-29 18:14:06 +08:00
parent f915b47a9a
commit 12febe94cf
7 changed files with 57 additions and 31 deletions

View File

@ -10,6 +10,7 @@ import (
"errors"
"fmt"
"github.com/mzz2017/softwind/netproxy"
"github.com/sirupsen/logrus"
"golang.org/x/net/dns/dnsmessage"
"net/netip"
"sync"
@ -21,6 +22,17 @@ type Ip46 struct {
}
func ResolveIp46(ctx context.Context, dialer netproxy.Dialer, dns netip.AddrPort, host string, tcp bool, race bool) (ipv46 *Ip46, err error) {
var log *logrus.Logger
if _log := ctx.Value("logger"); _log != nil {
log = _log.(*logrus.Logger)
defer func() {
if err == nil {
log.Tracef("ResolveIp46 %v using %v: A(%v) AAAA(%v)", host, systemDns, ipv46.Ip4, ipv46.Ip6)
} else {
log.Tracef("ResolveIp46 %v using %v: %v", host, systemDns, err)
}
}()
}
var wg sync.WaitGroup
wg.Add(2)
var err4, err6 error