summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Buquet <pep@bouah.net>2020-04-04 15:28:59 +0200
committerMaxime Buquet <pep@bouah.net>2020-04-04 15:28:59 +0200
commit76f4fb49d6ad44ccafb97748183ce04986f82cda (patch)
tree16a9290e3c1a273e4f0ea984a1705552b33a5f31
parenta16e2a0f6c6dcd3bde55fce1771b7bb5c22cf38c (diff)
parent5be46a5e688bd938f4346e71a5700a090fcda309 (diff)
downloadslixmpp-76f4fb49d6ad44ccafb97748183ce04986f82cda.tar.gz
slixmpp-76f4fb49d6ad44ccafb97748183ce04986f82cda.tar.bz2
slixmpp-76f4fb49d6ad44ccafb97748183ce04986f82cda.tar.xz
slixmpp-76f4fb49d6ad44ccafb97748183ce04986f82cda.zip
Merge branch 'sync-fixes' into 'master'
Sync fixes See merge request poezio/slixmpp!37
-rw-r--r--slixmpp/xmlstream/xmlstream.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index cbb7950a..06fa058c 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -380,6 +380,7 @@ class XMLStream(asyncio.BaseProtocol):
"ssl_object",
default=self.transport.get_extra_info("socket")
)
+ self._current_connection_attempt = None
self.init_parser()
self.send_raw(self.stream_header)
self.dns_answers = None
@@ -438,6 +439,9 @@ class XMLStream(asyncio.BaseProtocol):
self.send(error)
self.disconnect()
+ def is_connecting(self):
+ return self._current_connection_attempt is not None
+
def is_connected(self):
return self.transport is not None
@@ -512,6 +516,7 @@ class XMLStream(asyncio.BaseProtocol):
self.event("killed")
self.disconnected.set_result(True)
self.disconnected = asyncio.Future()
+ self.event("disconnected", self.disconnect_reason)
def reconnect(self, wait=2.0, reason="Reconnecting"):
"""Calls disconnect(), and once we are disconnected (after the timeout, or