Skip to content

Commit

Permalink
tunneld: ignore ConnectionAbortedError raised from CoreDeviceProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Sep 11, 2024
1 parent f755482 commit 26856a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pymobiledevice3/tunneld.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ async def monitor_usbmux_task(self) -> None:
continue
try:
service = CoreDeviceTunnelProxy(create_using_usbmux(mux_device.serial))
except (MuxException, InvalidServiceError, GetProhibitedError, construct.core.StreamError):
except (MuxException, InvalidServiceError, GetProhibitedError, construct.core.StreamError,
ConnectionAbortedError):
continue
self.tunnel_tasks[task_identifier] = TunnelTask(
udid=mux_device.serial,
Expand Down Expand Up @@ -380,7 +381,8 @@ async def clear_tunnels() -> fastapi.Response:
@self._app.get('/cancel')
async def cancel_tunnel(udid: str) -> fastapi.Response:
self._tunneld_core.cancel(udid=udid)
data = json.dumps({'operation': 'cancel', 'udid': udid, 'data': True, 'message': f'tunnel {udid} Canceled ...'})
data = json.dumps(
{'operation': 'cancel', 'udid': udid, 'data': True, 'message': f'tunnel {udid} Canceled ...'})
return generate_http_response(data)

@self._app.get('/hello')
Expand Down

0 comments on commit 26856a0

Please sign in to comment.