Don't keep buffer of all previously received data.

pull/35/head
David Wilson 9 years ago
parent 57a7395b8a
commit 358e753010

@ -80,13 +80,11 @@ def read_with_deadline(fd, size, deadline):
raise econtext.core.TimeoutError('read timed out')
def iter_read(fd, deadline):
buf = ''
while True:
s = os.read(fd, 4096)
if not s:
raise econtext.core.StreamError('EOF on stream; received %r', buf)
buf += s
yield buf
yield s
def discard_until(fd, s, deadline):

Loading…
Cancel
Save