Catch message type errors on connection parsing

This commit is contained in:
shortcutme 2017-06-19 16:16:13 +02:00
parent 9f72fdeb41
commit 7d9cb65ba1
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -157,11 +157,14 @@ class Connection(object):
self.unpacker.feed(buff)
buff = None
for message in self.unpacker:
try:
self.incomplete_buff_recv = 0
if "stream_bytes" in message:
self.handleStream(message)
else:
self.handleMessage(message)
except TypeError:
raise Exception("Invalid message type: %s" % type(message))
message = None
except Exception, err: