Skip to content

Commit

Permalink
Merge pull request #1274 from doronz88/bugfix/service-connection-devi…
Browse files Browse the repository at this point in the history
…ce-disconnect

service_connection: treat `SSLError` from `recv()` as disconnection
  • Loading branch information
doronz88 authored Nov 10, 2024
2 parents 8efde88 + 86e092d commit 096dcb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pymobiledevice3/service_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def recv(self, length: int = 4096) -> bytes:
:param length: The maximum amount of data to receive.
:return: The received data.
"""
return self.socket.recv(length)
try:
return self.socket.recv(length)
except ssl.SSLError:
raise ConnectionAbortedError()

def sendall(self, data: bytes) -> None:
"""
Expand Down

0 comments on commit 096dcb0

Please sign in to comment.