From 228f26e5b3400f7e1f45fa0f4e42e328939050d4 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 30 Nov 2015 21:54:38 +0100 Subject: [PATCH] plugin (xml log): workaround for a crash on big stanzas --- src/plugins/plugin_misc_xmllog.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/plugin_misc_xmllog.py b/src/plugins/plugin_misc_xmllog.py index 054460fb..eaad4dfd 100755 --- a/src/plugins/plugin_misc_xmllog.py +++ b/src/plugins/plugin_misc_xmllog.py @@ -49,7 +49,9 @@ class LoggingXmlStream(XmlStream): return XmlStream.send(self, obj) def dataReceived(self, data): - self._host.bridge.xmlLog("IN", data.decode('utf-8'), self._profile) + # FIXME: we use "replace" here because a big stanza can be cut in the middle of a unicode char + # this plugin should probably moved to a better place, where stanzas are fully received + self._host.bridge.xmlLog("IN", data.decode('utf-8', 'replace'), self._profile) return XmlStream.dataReceived(self, data)