dns: log error when adding an invalid record

This commit is contained in:
nadoo committed 2022-02-20 01:07:51 +08:00
1 parent 813c5fef94
commit cb698713ee
8 files changed
+34 -35

No files matched your search

+7 -6
View File
@@ -58,12 +58,13 @@ func NewTLS(s string, d proxy.Dialer, p proxy.Proxy) (*TLS, error) {
alpn: query["alpn"],
}
if _, port, _ := net.SplitHostPort(t.addr); port == "" {
t.addr = net.JoinHostPort(t.addr, "443")
}
if t.serverName == "" {
t.serverName = t.addr[:strings.LastIndex(t.addr, ":")]
if t.addr != "" {
if _, port, _ := net.SplitHostPort(t.addr); port == "" {
t.addr = net.JoinHostPort(t.addr, "443")
}
if t.serverName == "" {
t.serverName = t.addr[:strings.LastIndex(t.addr, ":")]
}
}
return t, nil