Try/except around outbound stanza processing
to avoid killing the send loop when a filter has an error
This commit is contained in:
parent
a32794ec35
commit
27d3ae958b
@ -902,6 +902,7 @@ class XMLStream(asyncio.BaseProtocol):
|
||||
"""
|
||||
while True:
|
||||
(data, use_filters) = await self.waiting_queue.get()
|
||||
try:
|
||||
if isinstance(data, ElementBase):
|
||||
if use_filters:
|
||||
for filter in self.__filters['out']:
|
||||
@ -926,6 +927,8 @@ class XMLStream(asyncio.BaseProtocol):
|
||||
self.send_raw(str_data)
|
||||
else:
|
||||
self.send_raw(data)
|
||||
except:
|
||||
log.error('Could not send stanza %s', data, exc_info=True)
|
||||
self.waiting_queue.task_done()
|
||||
|
||||
def send(self, data, use_filters=True):
|
||||
|
Loading…
Reference in New Issue
Block a user