Graceful handling of pause/resume when transport is closed
@@ -172,10 +172,12 @@ class HttpProtocol(asyncio.Protocol):
self.write_paused = False
def pause_reading(self):
+ if self.transport is not None:
self.transport.pause_reading()
self.read_paused = True
def resume_reading(self):
+ if self.transport is not None:
self.transport.resume_reading()
self.read_paused = False
