Skip to content

Commit

Permalink
restore: make wait for URLAsset on first chunk optional
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Aug 14, 2024
1 parent 5a965fb commit 555e872
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pymobiledevice3/restore/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ async def send_source_boot_object_v4(self, message: Mapping) -> None:
await service.aio_send_plist({'FileData': chunk})
if i == 0 and chunk.startswith(b'AEA1'):
self.logger.debug('First chunk in a AEA')
message = await service.aio_recv_plist()
await self.send_url_asset(message)
try:
async with asyncio.timeout(3):
message = await service.aio_recv_plist()
await self.send_url_asset(message)
except asyncio.TimeoutError:
self.logger.debug('No URLAsset was requested. Assuming it is not necessary')

# Send FileDataDone
await service.aio_send_plist({'FileDataDone': True})
Expand Down

0 comments on commit 555e872

Please sign in to comment.