diff options
| author | 2019-06-13 02:01:04 +0300 | |
|---|---|---|
| committer | 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) | |||
| 46 | return SERVICE_E_INVALID_ARG; | 46 | return SERVICE_E_INVALID_ARG; |
| 47 | case IDEVICE_E_SSL_ERROR: | 47 | case IDEVICE_E_SSL_ERROR: |
| 48 | return SERVICE_E_SSL_ERROR; | 48 | return SERVICE_E_SSL_ERROR; |
| 49 | case IDEVICE_E_NOT_ENOUGH_DATA: | ||
| 50 | return SERIVCE_E_NOT_ENOUGH_DATA; | ||
| 51 | case IDEVICE_E_TIMEOUT: | ||
| 52 | return SERVICE_E_TIMEOUT; | ||
| 49 | default: | 53 | default: |
| 50 | break; | 54 | break; |
| 51 | } | 55 | } |
| @@ -159,8 +163,9 @@ LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client | |||
| 159 | } | 163 | } |
| 160 | 164 | ||
| 161 | res = idevice_to_service_error(idevice_connection_receive_timeout(client->connection, data, size, (uint32_t*)&bytes, timeout)); | 165 | res = idevice_to_service_error(idevice_connection_receive_timeout(client->connection, data, size, (uint32_t*)&bytes, timeout)); |
| 162 | if (bytes <= 0) { | 166 | if (res != SERVICE_E_SUCCESS) { |
| 163 | debug_info("could not read data"); | 167 | debug_info("could not read data"); |
| 168 | return res; | ||
| 164 | } | 169 | } |
| 165 | if (received) { | 170 | if (received) { |
| 166 | *received = (uint32_t)bytes; | 171 | *received = (uint32_t)bytes; |
