diff options
author | Nikias Bassen | 2021-02-01 11:32:28 +0100 |
---|---|---|
committer | Nikias Bassen | 2021-02-01 11:32:28 +0100 |
commit | de1d724d0b753f21267da41eb4802e4f844f1331 (patch) | |
tree | df43ed6436bd9d9615044ae46f19c5729e7e4fd0 /src/preboard.c | |
parent | 09f2332f7d4cd0cc8c4646a63d75a3f037e2b9b2 (diff) | |
download | libimobiledevice-de1d724d0b753f21267da41eb4802e4f844f1331.tar.gz libimobiledevice-de1d724d0b753f21267da41eb4802e4f844f1331.tar.bz2 |
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.
Diffstat (limited to 'src/preboard.c')
0 files changed, 0 insertions, 0 deletions