Commit 28e3e216 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix timeout handling in LUXI client



If the socket can't be read in time, it raises “socket.timeout”, for
which there is special handling code. Unfortunately the exception block
was in the wrong order and “socket.error” caught it before.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 43217ac7
......@@ -228,12 +228,12 @@ class Transport:
while True:
try:
data = self.socket.recv(4096)
except socket.timeout, err:
raise TimeoutError("Receive timeout: %s" % str(err))
except socket.error, err:
if err.args and err.args[0] == errno.EAGAIN:
continue
raise
except socket.timeout, err:
raise TimeoutError("Receive timeout: %s" % str(err))
break
if not data:
raise ConnectionClosedError("Connection closed while reading")
......
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