Do not traceback when DNS resolution time out.

Just log that the resolution timed out, and fall back
to the hostname from the JID in this case
This commit is contained in:
Florent Le Coz 2011-01-20 04:23:00 +08:00 committed by Lance Stout
parent acc2d071ac
commit 897a9ac333

View file

@ -169,6 +169,8 @@ class ClientXMPP(BaseXMPP):
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
log.debug("No appropriate SRV record found." + \ log.debug("No appropriate SRV record found." + \
" Using JID server name.") " Using JID server name.")
except (dns.exception.Timeout,):
log.debug("DNS resolution timed out.")
else: else:
# Pick a random server, weighted by priority. # Pick a random server, weighted by priority.