iter_read: also treat 0-byte read as disconnection
This commit is contained in:
parent
46c361d4e1
commit
a18ca0f208
|
@ -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:],)
|
||||
|
|
Loading…
Reference in New Issue