summaryrefslogtreecommitdiff
path: root/sleekxmpp/clientxmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-02-09 21:28:28 -0800
committerLance Stout <lancestout@gmail.com>2012-02-09 21:28:28 -0800
commit1a272fd276fd5ab16506b205fcc75ba581873bc6 (patch)
treef2ab29fd56548d3f3b35821dd9274baa56dd2841 /sleekxmpp/clientxmpp.py
parent952260b423e628ab9a68ca52d09b6330c7508c62 (diff)
downloadslixmpp-1a272fd276fd5ab16506b205fcc75ba581873bc6.tar.gz
slixmpp-1a272fd276fd5ab16506b205fcc75ba581873bc6.tar.bz2
slixmpp-1a272fd276fd5ab16506b205fcc75ba581873bc6.tar.xz
slixmpp-1a272fd276fd5ab16506b205fcc75ba581873bc6.zip
Add support for querying and connecting to IPv6 addresses.
Tested using servers provided by Florian Jensen (flosoft.biz) during the 2012 FOSDEM XMPP Summit. Fixes issue #94.
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r--sleekxmpp/clientxmpp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index a836cbd9..d2a6bfee 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -166,8 +166,10 @@ class ClientXMPP(BaseXMPP):
try:
record = "_xmpp-client._tcp.%s" % domain
answers = []
+ log.debug("Querying SRV records for %s" % domain)
for answer in dns.resolver.query(record, dns.rdatatype.SRV):
address = (answer.target.to_text()[:-1], answer.port)
+ log.debug("Found SRV record: %s", address)
answers.append((address, answer.priority, answer.weight))
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
log.warning("No SRV records for %s", domain)
@@ -179,7 +181,7 @@ class ClientXMPP(BaseXMPP):
return answers
else:
log.warning("dnspython is not installed -- " + \
- "relying on OS A record resolution")
+ "relying on OS A/AAAA record resolution")
return [((domain, port), 0, 0)]
def register_feature(self, name, handler, restart=False, order=5000):