Don't use xmpps-client SRV records if target is "."

check-errors
Martin Dosch 3 years ago
parent ec185d75d7
commit 6df64d2446

@ -52,9 +52,11 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
// Look up xmpps-client SRV records.
if _, addrs, err := net.LookupSRV("xmpps-client", "tcp", server); err == nil {
if len(addrs) > 0 {
for _, adr := range addrs {
srvMixed = append(srvMixed, srv{adr.Target, true,
adr.Port, adr.Priority, adr.Weight})
if addrs[0].Target != "." {
for _, adr := range addrs {
srvMixed = append(srvMixed, srv{adr.Target, true,
adr.Port, adr.Priority, adr.Weight})
}
}
}
}

Loading…
Cancel
Save