Mercurial > libervia-backend
comparison src/plugins/plugin_misc_xmllog.py @ 1706:aa60bd58ac23
plugin (xml log): workaround for a crash on big stanzas
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 30 Nov 2015 21:54:38 +0100 |
parents | 301b342c697a |
children | 2daf7b4c6756 |
comparison
equal
deleted
inserted
replaced
1705:3765e10ec52f | 1706:aa60bd58ac23 |
---|---|
47 log.error(_('INTERNAL ERROR: Unmanaged XML type')) | 47 log.error(_('INTERNAL ERROR: Unmanaged XML type')) |
48 self._host.bridge.xmlLog("OUT", log, self._profile) | 48 self._host.bridge.xmlLog("OUT", log, self._profile) |
49 return XmlStream.send(self, obj) | 49 return XmlStream.send(self, obj) |
50 | 50 |
51 def dataReceived(self, data): | 51 def dataReceived(self, data): |
52 self._host.bridge.xmlLog("IN", data.decode('utf-8'), self._profile) | 52 # FIXME: we use "replace" here because a big stanza can be cut in the middle of a unicode char |
53 # this plugin should probably moved to a better place, where stanzas are fully received | |
54 self._host.bridge.xmlLog("IN", data.decode('utf-8', 'replace'), self._profile) | |
53 return XmlStream.dataReceived(self, data) | 55 return XmlStream.dataReceived(self, data) |
54 | 56 |
55 | 57 |
56 class XmlLog(object): | 58 class XmlLog(object): |
57 | 59 |