Commit 4af92009 authored by David Wilson's avatar David Wilson

iter_read: also treat 0-byte read as disconnection

parent d169b55d
......@@ -174,7 +174,8 @@ def iter_read(fd, deadline=None):
continue
s, disconnected = mitogen.core.io_op(os.read, fd, 4096)
if disconnected:
IOLOG.debug('iter_read(%r) -> %r', fd, s)
if disconnected or not s:
raise mitogen.core.StreamError(
'EOF on stream; last 300 bytes received: %r' %
(''.join(bits)[-300:],)
......
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