diff options
author | DanyL | 2019-06-13 02:01:04 +0300 |
---|---|---|
committer | Nikias Bassen | 2019-06-13 01:41:20 +0200 |
commit | 4d8b89223cbc9f530cc650ab5131c09eab1af258 (patch) | |
tree | e63216393208c07ae83c7b8eba5e0a9546de4fef /src/service.c | |
parent | 6edc36fccb52a963c9ebfbb44ba7b91570e0fd06 (diff) | |
download | libimobiledevice-4d8b89223cbc9f530cc650ab5131c09eab1af258.tar.gz libimobiledevice-4d8b89223cbc9f530cc650ab5131c09eab1af258.tar.bz2 |
Timeout support for SSL connections and better timeout handeling.
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c index 2dc42b2..57d987c 100644 --- a/src/service.c +++ b/src/service.c @@ -46,6 +46,10 @@ static service_error_t idevice_to_service_error(idevice_error_t err) return SERVICE_E_INVALID_ARG; case IDEVICE_E_SSL_ERROR: return SERVICE_E_SSL_ERROR; + case IDEVICE_E_NOT_ENOUGH_DATA: + return SERIVCE_E_NOT_ENOUGH_DATA; + case IDEVICE_E_TIMEOUT: + return SERVICE_E_TIMEOUT; default: break; } @@ -159,8 +163,9 @@ LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client } res = idevice_to_service_error(idevice_connection_receive_timeout(client->connection, data, size, (uint32_t*)&bytes, timeout)); - if (bytes <= 0) { + if (res != SERVICE_E_SUCCESS) { debug_info("could not read data"); + return res; } if (received) { *received = (uint32_t)bytes; |