diff options
| author | 2013-09-19 05:21:33 +0200 | |
|---|---|---|
| committer | 2013-09-19 05:21:33 +0200 | |
| commit | a84e717eecf2dda8221a8aa8569148c01f2505b0 (patch) | |
| tree | 96ac46767ff533d10cb02a77ea576f4d106446df /src/property_list_service.c | |
| parent | 193d032a040935664e7428d366345a6f6644a29a (diff) | |
| download | libimobiledevice-a84e717eecf2dda8221a8aa8569148c01f2505b0.tar.gz libimobiledevice-a84e717eecf2dda8221a8aa8569148c01f2505b0.tar.bz2 | |
property_list_service: handle timeout condition on receive
this adds the new error code PROPERTY_LIST_SERVICE_E_TIMEOUT that
occurs if the given timeout is reached when trying to receive data.
Diffstat (limited to 'src/property_list_service.c')
| -rw-r--r-- | src/property_list_service.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c index f1c3f86..28739c7 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c | |||
| @@ -223,7 +223,10 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis | |||
| 223 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; | 223 | return PROPERTY_LIST_SERVICE_E_INVALID_ARG; |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | service_receive_with_timeout(client->parent, (char*)&pktlen, sizeof(pktlen), &bytes, timeout); | 226 | service_error_t serr = service_receive_with_timeout(client->parent, (char*)&pktlen, sizeof(pktlen), &bytes, timeout); |
| 227 | if ((serr == SERVICE_E_SUCCESS) && (bytes == 0)) { | ||
| 228 | return PROPERTY_LIST_SERVICE_E_TIMEOUT; | ||
| 229 | } | ||
| 227 | debug_info("initial read=%i", bytes); | 230 | debug_info("initial read=%i", bytes); |
| 228 | if (bytes < 4) { | 231 | if (bytes < 4) { |
| 229 | debug_info("initial read failed!"); | 232 | debug_info("initial read failed!"); |
