fix Out Of Memory when use TNonblockingServer
diff --git a/lib/py/src/server/TNonblockingServer.py b/lib/py/src/server/TNonblockingServer.py
index f62d486..ac06496 100644
--- a/lib/py/src/server/TNonblockingServer.py
+++ b/lib/py/src/server/TNonblockingServer.py
@@ -151,6 +151,10 @@
while len(self._rbuf) >= self._reading.end:
if self._reading.is_header:
mlen, = struct.unpack('!i', self._rbuf[:4])
+ if mlen < 0:
+ logger.error('could not read the head from frame')
+ self.close()
+ break
self._reading = Message(self._reading.end, mlen, False)
self.status = WAIT_MESSAGE
else: