Commit 7764d956 authored by Vincent Pelletier's avatar Vincent Pelletier

Do not raise on disconnection if a response was received.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2390 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 41e7ee66
......@@ -53,11 +53,12 @@ class NeoCTL(object):
connection.ask(packet)
response_queue = self.response_queue
assert len(response_queue) == 0
while len(response_queue) == 0:
# XXX: this burn the CPU
self.em.poll(0)
if not self.connected:
raise NotReadyException, 'Connection closed'
while self.connected:
self.em.poll(1)
if response_queue:
break
else:
raise NotReadyException, 'Connection closed'
response = response_queue.pop()
if response[0] == Packets.Error and \
response[1] == ErrorCodes.NOT_READY:
......
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