Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions awscrt/aio/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def _on_body(self, chunk: bytes) -> None:
"""Process body chunk on the correct event loop thread."""
if self._chunk_futures:
future = self._chunk_futures.popleft()
future.set_result(chunk)
if not future.done():
future.set_result(chunk)
else:
self._received_chunks.append(chunk)

Expand All @@ -309,7 +310,8 @@ def _on_complete(self, error_code: int) -> None:
# Resolve all pending chunk futures with an empty string to indicate end of stream
while self._chunk_futures:
future = self._chunk_futures.popleft()
future.set_result("")
if not future.done():
future.set_result("")

async def _set_request_body_generator(self, body_iterator: AsyncIterator[bytes]):
...
Expand Down