summaryrefslogtreecommitdiffstats
path: root/src/installation_proxy.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-11-10 22:55:11 +0100
committerGravatar Martin Szulecki2013-11-10 22:55:11 +0100
commit3c3a791794f86d58605d1c6098c249a713af2a48 (patch)
treecd1835026ce4eef185cacf53bfe612b11d2fcb02 /src/installation_proxy.c
parenta12a053190c252498f171999cf5927d782fdbcb7 (diff)
downloadlibimobiledevice-3c3a791794f86d58605d1c6098c249a713af2a48.tar.gz
libimobiledevice-3c3a791794f86d58605d1c6098c249a713af2a48.tar.bz2
installation_proxy: Fix operations exiting before being finished due to timeout
The internal status callback used a timeout of 30 seconds to receive status messages about the progress of an operation. However, slow devices or large app archives trigger this timeout causing the handler to return before the operation was actually complete. This fixes it by removing the internal timeout by waiting forever and only returning early in case of a real error.
Diffstat (limited to 'src/installation_proxy.c')
-rw-r--r--src/installation_proxy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index 7ee12cc..f758a14 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -2,6 +2,7 @@
2 * installation_proxy.c 2 * installation_proxy.c
3 * com.apple.mobile.installation_proxy service implementation. 3 * com.apple.mobile.installation_proxy service implementation.
4 * 4 *
5 * Copyright (c) 2013 Martin Szulecki All Rights Reserved.
5 * Copyright (c) 2009 Nikias Bassen, All Rights Reserved. 6 * Copyright (c) 2009 Nikias Bassen, All Rights Reserved.
6 * 7 *
7 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
@@ -230,7 +231,7 @@ instproxy_error_t instproxy_browse(instproxy_client_t client, plist_t client_opt
230 browsing = 0; 231 browsing = 0;
231 dict = NULL; 232 dict = NULL;
232 res = instproxy_error(property_list_service_receive_plist(client->parent, &dict)); 233 res = instproxy_error(property_list_service_receive_plist(client->parent, &dict));
233 if (res != INSTPROXY_E_SUCCESS) { 234 if (res != INSTPROXY_E_SUCCESS && res != INSTPROXY_E_RECEIVE_TIMEOUT) {
234 break; 235 break;
235 } 236 }
236 if (dict) { 237 if (dict) {
@@ -297,9 +298,9 @@ static instproxy_error_t instproxy_perform_operation(instproxy_client_t client,
297 298
298 do { 299 do {
299 instproxy_lock(client); 300 instproxy_lock(client);
300 res = instproxy_error(property_list_service_receive_plist_with_timeout(client->parent, &dict, 30000)); 301 res = instproxy_error(property_list_service_receive_plist_with_timeout(client->parent, &dict, 1000));
301 instproxy_unlock(client); 302 instproxy_unlock(client);
302 if (res != INSTPROXY_E_SUCCESS) { 303 if (res != INSTPROXY_E_SUCCESS && res != INSTPROXY_E_RECEIVE_TIMEOUT) {
303 debug_info("could not receive plist, error %d", res); 304 debug_info("could not receive plist, error %d", res);
304 break; 305 break;
305 } 306 }
@@ -376,7 +377,7 @@ static void* instproxy_status_updater(void* arg)
376 instproxy_lock(data->client); 377 instproxy_lock(data->client);
377 debug_info("done, cleaning up."); 378 debug_info("done, cleaning up.");
378 if (data->operation) { 379 if (data->operation) {
379 free(data->operation); 380 free(data->operation);
380 } 381 }
381 data->client->status_updater = (thread_t)NULL; 382 data->client->status_updater = (thread_t)NULL;
382 instproxy_unlock(data->client); 383 instproxy_unlock(data->client);