equal
deleted
inserted
replaced
108 exts = append(exts, bindExt) |
108 exts = append(exts, bindExt) |
109 |
109 |
110 // Resolve the domain in the JID. |
110 // Resolve the domain in the JID. |
111 _, srvs, err := net.LookupSRV(clientSrv, "tcp", jid.Domain) |
111 _, srvs, err := net.LookupSRV(clientSrv, "tcp", jid.Domain) |
112 if err != nil { |
112 if err != nil { |
113 return nil, errors.New("LookupSrv " + jid.Domain + |
113 return nil, fmt.Errorf("LookupSrv %s: %v", jid.Domain, err) |
114 ": " + err.Error()) |
114 } |
|
115 if len(srvs) == 0 { |
|
116 return nil, fmt.Errorf("LookupSrv %s: no results", jid.Domain) |
115 } |
117 } |
116 |
118 |
117 var tcp *net.TCPConn |
119 var tcp *net.TCPConn |
118 for _, srv := range srvs { |
120 for _, srv := range srvs { |
119 addrStr := fmt.Sprintf("%s:%d", srv.Target, srv.Port) |
121 addrStr := fmt.Sprintf("%s:%d", srv.Target, srv.Port) |