Skip to content
Merged
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
4 changes: 2 additions & 2 deletions pymongo/network_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ async def _async_receive_ssl(
while total_read < length:
try:
read = conn.recv_into(mv[total_read:])
if read == 0:
raise OSError("connection closed")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to check for a 0-read first.

# KMS responses update their expected size after the first batch, stop reading after one loop
if once:
return mv[:read]
if read == 0:
raise OSError("connection closed")
except BLOCKING_IO_ERRORS:
await asyncio.sleep(backoff)
read = 0
Expand Down
Loading