Skip to content

Commit

Permalink
service_connection: ignore IncompleteReadError in aio_recvall()
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Oct 20, 2024
1 parent b013644 commit 9188102
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pymobiledevice3/service_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ def recv_prefixed(self, endianity='>') -> bytes:

async def aio_recvall(self, size: int) -> bytes:
""" receive a payload """
return await self.reader.readexactly(size)
data = b''
while len(data) < size:
try:
data += await self.reader.readexactly(size)
except asyncio.IncompleteReadError:
pass
return data

async def aio_recv_prefixed(self, endianity='>') -> bytes:
""" receive a data block prefixed with a u32 length field """
Expand Down

0 comments on commit 9188102

Please sign in to comment.