aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorehendrix232019-02-21 23:41:02 (GMT)
committerehendrix232019-02-21 23:41:02 (GMT)
commit696a72247b3bee091a85cfa0b0f4dd451cc1074f (patch)
treef4cd9bda87a59a5debe65d61df4b0fa5b6d64b5f
parent05d76e4b1d7d4992346fac40d87281387431b8e0 (diff)
downloadslixmpp-696a72247b3bee091a85cfa0b0f4dd451cc1074f.tar.gz
slixmpp-696a72247b3bee091a85cfa0b0f4dd451cc1074f.tar.xz
-rw-r--r--slixmpp/xmlstream/xmlstream.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 60557ff..db3d468 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -310,6 +310,8 @@ class XMLStream(asyncio.BaseProtocol):
ssl_context = None
await asyncio.sleep(self.connect_loop_wait, loop=self.loop)
+ if self._current_connection_attempt is None:
+ return
try:
await self.loop.create_connection(lambda: self,
self.address[0],
@@ -323,6 +325,8 @@ class XMLStream(asyncio.BaseProtocol):
except OSError as e:
log.debug('Connection failed: %s', e)
self.event("connection_failed", e)
+ if self._current_connection_attempt is None:
+ return
self.connect_loop_wait = self.connect_loop_wait * 2 + 1
self._current_connection_attempt = asyncio.ensure_future(
self._connect_routine(),