Address a bug that can happen if no SRV records can be found.
--- a/xmpp/xmpp.go Sat Sep 07 14:43:54 2013 -0700
+++ b/xmpp/xmpp.go Sat Sep 07 19:49:57 2013 -0700
@@ -110,8 +110,10 @@
// Resolve the domain in the JID.
_, srvs, err := net.LookupSRV(clientSrv, "tcp", jid.Domain)
if err != nil {
- return nil, errors.New("LookupSrv " + jid.Domain +
- ": " + err.Error())
+ return nil, fmt.Errorf("LookupSrv %s: %v", jid.Domain, err)
+ }
+ if len(srvs) == 0 {
+ return nil, fmt.Errorf("LookupSrv %s: no results", jid.Domain)
}
var tcp *net.TCPConn