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:
|
while True:
|
||||||
(data, use_filters) = await self.waiting_queue.get()
|
(data, use_filters) = await self.waiting_queue.get()
|
||||||
|
try:
|
||||||
if isinstance(data, ElementBase):
|
if isinstance(data, ElementBase):
|
||||||
if use_filters:
|
if use_filters:
|
||||||
for filter in self.__filters['out']:
|
for filter in self.__filters['out']:
|
||||||
@ -926,6 +927,8 @@ class XMLStream(asyncio.BaseProtocol):
|
|||||||
self.send_raw(str_data)
|
self.send_raw(str_data)
|
||||||
else:
|
else:
|
||||||
self.send_raw(data)
|
self.send_raw(data)
|
||||||
|
except:
|
||||||
|
log.error('Could not send stanza %s', data, exc_info=True)
|
||||||
self.waiting_queue.task_done()
|
self.waiting_queue.task_done()
|
||||||
|
|
||||||
def send(self, data, use_filters=True):
|
def send(self, data, use_filters=True):
|
||||||
|
Loading…
Reference in New Issue
Block a user