plugin (xml log): workaround for a crash on big stanzas

This commit is contained in:
Goffi 2015-11-30 21:54:38 +01:00
commit 228f26e5b3

View file

@ -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)