diff options
author | mathieui <mathieui@mathieui.net> | 2019-03-15 00:38:35 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2019-03-15 00:38:35 +0100 |
commit | 5629e44710cb1b75fdd8d71ad7c8f8dc94a81304 (patch) | |
tree | fcb4aecbd4d15c51be4c5cbbdc2aa01260599c96 | |
parent | 6a06881d8bff2501bd86e1515f5af096e7cf2c37 (diff) | |
parent | 696a72247b3bee091a85cfa0b0f4dd451cc1074f (diff) | |
download | slixmpp-5629e44710cb1b75fdd8d71ad7c8f8dc94a81304.tar.gz slixmpp-5629e44710cb1b75fdd8d71ad7c8f8dc94a81304.tar.bz2 slixmpp-5629e44710cb1b75fdd8d71ad7c8f8dc94a81304.tar.xz slixmpp-5629e44710cb1b75fdd8d71ad7c8f8dc94a81304.zip |
Merge branch 'patch-1' into 'master'
Fix slixmpp.ClientXMPP.cancel_connection_attempt()
See merge request poezio/slixmpp!10
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 60557fff..db3d4684 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(), |