Only use pure-python msgpack for socket streaming

This commit is contained in:
shortcutme 2017-08-09 14:17:58 +02:00
parent bdb5e1597c
commit 4f729aa98f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 4 additions and 3 deletions

View file

@ -3,6 +3,7 @@ import time
import gevent
import msgpack
import msgpack.fallback
from Config import config
from Debug import Debug
@ -138,7 +139,7 @@ class Connection(object):
self.connected = True
buff_len = 0
self.unpacker = msgpack.Unpacker()
self.unpacker = msgpack.fallback.Unpacker() # Due memory problems of C version
try:
while not self.closed:
buff = self.sock.recv(16 * 1024)
@ -153,7 +154,7 @@ class Connection(object):
self.server.bytes_recv += buff_len
if not self.unpacker:
self.unpacker = msgpack.Unpacker()
self.unpacker = msgpack.fallback.Unpacker()
self.unpacker.feed(buff)
buff = None
for message in self.unpacker: