mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-12 13:10:25 +00:00
Remove trailing . of hostnames.
This commit is contained in:
parent
4ac87d88e1
commit
9044bbb998
@ -44,8 +44,8 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
||||
if _, addrs, err := net.LookupSRV("xmpp-client", "tcp", server); err == nil {
|
||||
if len(addrs) > 0 {
|
||||
for _, adr := range addrs {
|
||||
srvMixed = append(srvMixed, srv{adr.Target, false,
|
||||
adr.Port, adr.Priority, adr.Weight})
|
||||
srvMixed = append(srvMixed, srv{strings.TrimSuffix(adr.Target, "."),
|
||||
false, adr.Port, adr.Priority, adr.Weight})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -54,8 +54,9 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
||||
if len(addrs) > 0 {
|
||||
if addrs[0].Target != "." {
|
||||
for _, adr := range addrs {
|
||||
srvMixed = append(srvMixed, srv{adr.Target, true,
|
||||
adr.Port, adr.Priority, adr.Weight})
|
||||
srvMixed = append(srvMixed,
|
||||
srv{strings.TrimSuffix(adr.Target, "."), true, adr.Port,
|
||||
adr.Priority, adr.Weight})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user