Need to check if transport is closing to avoid getting stuck in sending loops after peer has disconnected.
This commit is contained in:
parent
2adcc72e06
commit
d2d6008eec
|
@ -184,6 +184,8 @@ class HttpProtocol(asyncio.Protocol):
|
|||
async def send(self, data):
|
||||
"""Writes data with backpressure control."""
|
||||
await self._can_write.wait()
|
||||
if self.transport.is_closing():
|
||||
raise CancelledError
|
||||
self.transport.write(data)
|
||||
self._time = current_time()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user