Commit a0d9f25d authored by Grégory Wisniewski's avatar Grégory Wisniewski

Check return value only if the call succeed.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1701 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6ff9fa0e
...@@ -259,15 +259,14 @@ class Connection(BaseConnection): ...@@ -259,15 +259,14 @@ class Connection(BaseConnection):
def analyse(self): def analyse(self):
"""Analyse received data.""" """Analyse received data."""
while True: while True:
packet = None
try: try:
packet = Packets.parse(self.read_buf) packet = Packets.parse(self.read_buf)
if packet is None:
break
except PacketMalformedError, msg: except PacketMalformedError, msg:
self.handler._packetMalformed(self, packet, msg) self.handler._packetMalformed(self, packet, msg)
return return
if packet is None:
break
# Remove idle events, if appropriate packets were received. # Remove idle events, if appropriate packets were received.
for msg_id in (None, packet.getId()): for msg_id in (None, packet.getId()):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment