* fix abort call errors out when calling inside stream handler * handle pending task properly after cleanup
This commit is contained in:
parent
2d72874b0b
commit
028778ed56
|
@ -364,6 +364,21 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
else:
|
else:
|
||||||
self.request.body_push(body)
|
self.request.body_push(body)
|
||||||
|
|
||||||
|
async def body_append(self, body):
|
||||||
|
if (
|
||||||
|
self.request is None
|
||||||
|
or self._request_stream_task is None
|
||||||
|
or self._request_stream_task.cancelled()
|
||||||
|
):
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.request.stream.is_full():
|
||||||
|
self.transport.pause_reading()
|
||||||
|
await self.request.stream.put(body)
|
||||||
|
self.transport.resume_reading()
|
||||||
|
else:
|
||||||
|
await self.request.stream.put(body)
|
||||||
|
|
||||||
async def stream_append(self):
|
async def stream_append(self):
|
||||||
while self._body_chunks:
|
while self._body_chunks:
|
||||||
body = self._body_chunks.popleft()
|
body = self._body_chunks.popleft()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user