This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
idevice: Allow partial reads in idevice_connection_receive_timeout() …
…and handle timeouts more adequate idevice_connection_receive_timeout(), when in SSL mode, was assuming it should always try to read the exact amount of data specified in `len` parameter. While this works with most protocols that have length fields or fixed sized headers/packets, some others (e.g. debugserver) break because it will request a read but doesn't know the size that is expected to be returned beforehand. This commit will handle timeouts better and return the number of bytes that were read in such cases (instead of returning 0 bytes read + error). Note that in the event of a timeout, IDEVICE_E_TIMEOUT will be returned even though actual data might have been read. The number of bytes read will be returned in recv_bytes.
- Loading branch information