mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Fix: dns crash & remove unused debug log
This commit is contained in:
parent
731ca6e397
commit
4e33035730
|
@ -68,7 +68,7 @@ type rawConfig struct {
|
|||
ExternalController string `yaml:"external-controller"`
|
||||
Secret string `yaml:"secret"`
|
||||
|
||||
DNS *rawDNS `yaml:"dns"`
|
||||
DNS rawDNS `yaml:"dns"`
|
||||
Proxy []map[string]interface{} `yaml:"Proxy"`
|
||||
ProxyGroup []map[string]interface{} `yaml:"Proxy Group"`
|
||||
Rule []string `yaml:"Rule"`
|
||||
|
@ -95,7 +95,7 @@ func readConfig(path string) (*rawConfig, error) {
|
|||
Rule: []string{},
|
||||
Proxy: []map[string]interface{}{},
|
||||
ProxyGroup: []map[string]interface{}{},
|
||||
DNS: &rawDNS{
|
||||
DNS: rawDNS{
|
||||
Enable: false,
|
||||
},
|
||||
}
|
||||
|
@ -353,7 +353,6 @@ func hostWithDefaultPort(host string, defPort string) (string, error) {
|
|||
|
||||
func parseNameServer(servers []string) ([]dns.NameServer, error) {
|
||||
nameservers := []dns.NameServer{}
|
||||
log.Debugln("%#v", servers)
|
||||
|
||||
for idx, server := range servers {
|
||||
// parse without scheme .e.g 8.8.8.8:53
|
||||
|
@ -387,7 +386,7 @@ func parseNameServer(servers []string) ([]dns.NameServer, error) {
|
|||
return nameservers, nil
|
||||
}
|
||||
|
||||
func parseDNS(cfg *rawDNS) (*DNS, error) {
|
||||
func parseDNS(cfg rawDNS) (*DNS, error) {
|
||||
if cfg.Enable && len(cfg.NameServer) == 0 {
|
||||
return nil, fmt.Errorf("If DNS configuration is turned on, NameServer cannot be empty")
|
||||
}
|
||||
|
|
|
@ -244,8 +244,6 @@ func New(config Config) *Resolver {
|
|||
mmdb, _ = geoip2.Open(C.Path.MMDB())
|
||||
})
|
||||
|
||||
println(config.EnhancedMode)
|
||||
|
||||
r := &Resolver{
|
||||
main: transform(config.Main),
|
||||
ipv6: config.IPv6,
|
||||
|
|
|
@ -120,8 +120,6 @@ func (t *Tunnel) handleConn(localConn C.ServerAdapter) {
|
|||
log.Debugln("[DNS] %s --> %s", metadata.Host, ip.String())
|
||||
metadata.IP = &ip
|
||||
}
|
||||
} else {
|
||||
log.Debugln("[DNS] unknown%#v", metadata)
|
||||
}
|
||||
|
||||
var proxy C.Proxy
|
||||
|
|
Loading…
Reference in New Issue
Block a user