Commit c2edbea6 authored by Dan Fairs's avatar Dan Fairs
Browse files

Check that the response is not closed each time around the loop.

parent a6d701d7
......@@ -141,12 +141,8 @@ class Stream(object):
self.running = False
def _read_loop(self, resp):
while self.running:
if resp.isclosed():
buf = ''
while True:
while self.running and not resp.isclosed():
c =
idx = c.rfind('\n')
if idx > -1:
......@@ -161,6 +157,7 @@ class Stream(object):
# buffer
buf += c
def _start(self, async):
self.running = True
if async:
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