Skip to content

Commit 54c279f

Browse files
Close the stream as early as possible
1 parent d541870 commit 54c279f

File tree

1 file changed

+4
-0
lines changed
  • packages/smithy-http/src/smithy_http/aio

1 file changed

+4
-0
lines changed

packages/smithy-http/src/smithy_http/aio/crt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ def read(self, size: int | None = -1) -> bytes:
362362
return b""
363363

364364
if len(self._chunks) == 0:
365+
if self._done:
366+
self.close()
367+
return b""
368+
365369
# When the CRT recieves this, it'll try again later.
366370
raise BlockingIOError("read")
367371

0 commit comments

Comments
 (0)