Fix issue with SRV lookup for xmpps-client.

This commit is contained in:
Martin Dosch 2021-01-21 11:31:16 +01:00
parent 6c3fe6246a
commit e4e33cdf75

View File

@ -288,8 +288,11 @@ func main() {
server = *flagServer
}
// Lookup SRV record for xmpps-client if direct TLS is requested and the server is not
// specified.
// Determine server part if no server is specified.
if server == "" {
server = strings.Split(user, "@")[1]
// Lookup SRV record for xmpps-client if direct TLS is requested
if *flagTLS {
if _, addrs, err := net.LookupSRV("xmpps-client", "tcp", server); err == nil {
@ -307,9 +310,6 @@ func main() {
}
}
// Use the JIDs server part if no server is specified.
if server == "" {
server = strings.Split(user, "@")[1]
}
// Overwrite password if specified via command line flag.