summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slixmpp/__init__.py3
-rw-r--r--slixmpp/xmlstream/resolver.py2
-rw-r--r--slixmpp/xmlstream/xmlstream.py1
3 files changed, 4 insertions, 2 deletions
diff --git a/slixmpp/__init__.py b/slixmpp/__init__.py
index c09446df..46804bf5 100644
--- a/slixmpp/__init__.py
+++ b/slixmpp/__init__.py
@@ -7,7 +7,8 @@
"""
import asyncio
-asyncio.sslproto._is_sslproto_available=lambda: False
+if hasattr(asyncio, 'sslproto'): # no ssl proto: very old asyncio = no need for this
+ asyncio.sslproto._is_sslproto_available=lambda: False
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
diff --git a/slixmpp/xmlstream/resolver.py b/slixmpp/xmlstream/resolver.py
index 778f7dc3..56cf3872 100644
--- a/slixmpp/xmlstream/resolver.py
+++ b/slixmpp/xmlstream/resolver.py
@@ -240,7 +240,7 @@ def get_AAAA(host, resolver=None, use_aiodns=True, loop=None):
except Exception as e:
log.debug('DNS: Exception while querying for %s AAAA records: %s', host, e)
recs = []
- return recs
+ return [rec.host for rec in recs]
@asyncio.coroutine
def get_SRV(host, port, service, proto='tcp', resolver=None, use_aiodns=True):
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 28bfb17c..f11a4a16 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -348,6 +348,7 @@ class XMLStream(asyncio.BaseProtocol):
self.socket = self.transport.get_extra_info("socket")
self.init_parser()
self.send_raw(self.stream_header)
+ self.dns_answers = None
def data_received(self, data):
"""Called when incoming data is received on the socket.