diff options
author | mathieui <mathieui@mathieui.net> | 2021-01-23 16:14:59 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-01-28 17:54:40 +0100 |
commit | 8700f8d162c4b863f045c2459d68406c04e35bad (patch) | |
tree | 5bf6319d2524c44bb1f84989a7eefdfe3db555c5 | |
parent | efdcd396d8b7314e29212c31869a725a72ef5f78 (diff) | |
download | slixmpp-8700f8d162c4b863f045c2459d68406c04e35bad.tar.gz slixmpp-8700f8d162c4b863f045c2459d68406c04e35bad.tar.bz2 slixmpp-8700f8d162c4b863f045c2459d68406c04e35bad.tar.xz slixmpp-8700f8d162c4b863f045c2459d68406c04e35bad.zip |
xmlstream: do not cancel the send filter task
it does not make sense to cancel it, it does not do anything when the
sending queue is empty, and clients should not fill the send queue when
not connected anyway.
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 77bb9e4a..5b245e11 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -272,7 +272,7 @@ class XMLStream(asyncio.BaseProtocol): localhost """ - if self._run_filters is None: + if self._run_filters is None or self._run_filters.done(): self._run_filters = asyncio.ensure_future( self.run_filters(), loop=self.loop, @@ -463,8 +463,6 @@ class XMLStream(asyncio.BaseProtocol): self.parser = None self.transport = None self.socket = None - if self._run_filters: - self._run_filters.cancel() # Fire the events after cleanup if self.end_session_on_disconnect: self.event('session_end') @@ -480,8 +478,6 @@ class XMLStream(asyncio.BaseProtocol): if self._current_connection_attempt: self._current_connection_attempt.cancel() self._current_connection_attempt = None - if self._run_filters: - self._run_filters.cancel() def disconnect(self, wait: float = 2.0, reason: Optional[str] = None, ignore_send_queue: bool = False) -> None: """Close the XML stream and wait for an acknowldgement from the server for @@ -975,7 +971,6 @@ class XMLStream(asyncio.BaseProtocol): else: self.send_raw(data) - async def run_filters(self): """ Background loop that processes stanzas to send. |