Doesn't fail if host has NO SRV record
Just catch an other exception type coming from the dns resolver that could be raised with hosts like "anon.example.com" which just don't have any SRV record.
This commit is contained in:

committed by
Lance Stout

parent
4fb77ac878
commit
9dbf246f0b
@@ -164,7 +164,7 @@ class ClientXMPP(BaseXMPP):
|
||||
try:
|
||||
xmpp_srv = "_xmpp-client._tcp.%s" % self.server
|
||||
answers = dns.resolver.query(xmpp_srv, dns.rdatatype.SRV)
|
||||
except dns.resolver.NXDOMAIN:
|
||||
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
|
||||
log.debug("No appropriate SRV record found." + \
|
||||
" Using JID server name.")
|
||||
else:
|
||||
|
Reference in New Issue
Block a user