summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-02-18 22:29:02 +0100
committermathieui <mathieui@mathieui.net>2022-02-18 22:29:02 +0100
commit28fe68c7d3444d5eda4446f0a8510fbf5466f1ba (patch)
tree5d704cb85e4ad9154160c694b463795ba3ee0e7c
parent98dba869c74f8f76d70d802ad13c0974905794e1 (diff)
parentd15a37e14653e9f86318bd2528523ec4f156e932 (diff)
downloadslixmpp-28fe68c7d3444d5eda4446f0a8510fbf5466f1ba.tar.gz
slixmpp-28fe68c7d3444d5eda4446f0a8510fbf5466f1ba.tar.bz2
slixmpp-28fe68c7d3444d5eda4446f0a8510fbf5466f1ba.tar.xz
slixmpp-28fe68c7d3444d5eda4446f0a8510fbf5466f1ba.zip
Merge branch 'end-filter-run' into 'master'
fix: allow cancelling the run_filters coroutine See merge request poezio/slixmpp!184
-rw-r--r--slixmpp/xmlstream/xmlstream.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 67238cc6..7b362203 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -1239,7 +1239,7 @@ class XMLStream(asyncio.BaseProtocol):
else:
self.send_raw(data)
- async def run_filters(self) -> NoReturn:
+ async def run_filters(self) -> None:
"""
Background loop that processes stanzas to send.
"""
@@ -1295,6 +1295,9 @@ class XMLStream(asyncio.BaseProtocol):
self.send_raw(data)
except ContinueQueue as exc:
log.debug('Stanza in send queue not sent: %s', exc)
+ except asyncio.CancelledError:
+ log.debug('Send coroutine received cancel(), stopping')
+ return
except Exception:
log.error('Exception raised in send queue:', exc_info=True)
self.waiting_queue.task_done()