summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Marc Prud'hommeaux2022-03-10 23:33:12 +0100
committerGravatar Nikias Bassen2022-05-09 13:18:25 +0200
commitdd8a2de8e0bb8e2e81a83234db524a07969b6ad3 (patch)
treee568e269d887093bf79a1364bb8c5830b111277a
parent2b48c417c5b4f2fa78ab0960eb718ff081fa48e6 (diff)
downloadlibimobiledevice-dd8a2de8e0bb8e2e81a83234db524a07969b6ad3.tar.gz
libimobiledevice-dd8a2de8e0bb8e2e81a83234db524a07969b6ad3.tar.bz2
instproxy: Use synchronous mode when callbacks are NULL, as documented
Synchronous modes for `instproxy_install`, `instproxy_upgrade`, `instproxy_uninstall`, `instproxy_archive`, `instproxy_restore`, and `instproxy_remove_archive` appear to be ignoring the documented behavior that “If NULL is passed, this function will run synchronously”. This commit fixes the advertised behavior.
-rw-r--r--src/installation_proxy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index eedddc7..b13abf9 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -660,7 +660,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_install(instproxy_client_t clie
660 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); 660 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
661 plist_dict_set_item(command, "PackagePath", plist_new_string(pkg_path)); 661 plist_dict_set_item(command, "PackagePath", plist_new_string(pkg_path));
662 662
663 res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data); 663 res = instproxy_perform_command(client, command, status_cb == NULL ? INSTPROXY_COMMAND_TYPE_SYNC : INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data);
664 664
665 plist_free(command); 665 plist_free(command);
666 666
@@ -677,7 +677,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_upgrade(instproxy_client_t clie
677 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); 677 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
678 plist_dict_set_item(command, "PackagePath", plist_new_string(pkg_path)); 678 plist_dict_set_item(command, "PackagePath", plist_new_string(pkg_path));
679 679
680 res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data); 680 res = instproxy_perform_command(client, command, status_cb == NULL ? INSTPROXY_COMMAND_TYPE_SYNC : INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data);
681 681
682 plist_free(command); 682 plist_free(command);
683 683
@@ -694,7 +694,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_uninstall(instproxy_client_t cl
694 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); 694 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
695 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid)); 695 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid));
696 696
697 res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data); 697 res = instproxy_perform_command(client, command, status_cb == NULL ? INSTPROXY_COMMAND_TYPE_SYNC : INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data);
698 698
699 plist_free(command); 699 plist_free(command);
700 700
@@ -727,7 +727,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_archive(instproxy_client_t clie
727 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); 727 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
728 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid)); 728 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid));
729 729
730 res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data); 730 res = instproxy_perform_command(client, command, status_cb == NULL ? INSTPROXY_COMMAND_TYPE_SYNC : INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data);
731 731
732 plist_free(command); 732 plist_free(command);
733 733
@@ -744,7 +744,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_restore(instproxy_client_t clie
744 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); 744 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
745 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid)); 745 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid));
746 746
747 res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data); 747 res = instproxy_perform_command(client, command, status_cb == NULL ? INSTPROXY_COMMAND_TYPE_SYNC : INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data);
748 748
749 plist_free(command); 749 plist_free(command);
750 750
@@ -761,7 +761,7 @@ LIBIMOBILEDEVICE_API instproxy_error_t instproxy_remove_archive(instproxy_client
761 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options)); 761 plist_dict_set_item(command, "ClientOptions", plist_copy(client_options));
762 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid)); 762 plist_dict_set_item(command, "ApplicationIdentifier", plist_new_string(appid));
763 763
764 res = instproxy_perform_command(client, command, INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data); 764 res = instproxy_perform_command(client, command, status_cb == NULL ? INSTPROXY_COMMAND_TYPE_SYNC : INSTPROXY_COMMAND_TYPE_ASYNC, status_cb, user_data);
765 765
766 plist_free(command); 766 plist_free(command);
767 767