diff options
author | Jonathan Beck | 2009-01-22 22:21:12 +0100 |
---|---|---|
committer | Jonathan Beck | 2009-01-22 22:21:12 +0100 |
commit | 0934d1ac021dfb7907e4b580b38aa4a938cf2180 (patch) | |
tree | eceb50d36559f5442c0123320336c5c7d96e996a /src/MobileSync.c | |
parent | 7f2e0f5f719a7092b45b0b7d538137a9b7d78567 (diff) | |
download | libimobiledevice-0934d1ac021dfb7907e4b580b38aa4a938cf2180.tar.gz libimobiledevice-0934d1ac021dfb7907e4b580b38aa4a938cf2180.tar.bz2 |
Move things around and clean up some code.
Diffstat (limited to 'src/MobileSync.c')
-rw-r--r-- | src/MobileSync.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/MobileSync.c b/src/MobileSync.c index a2a361e..752aee9 100644 --- a/src/MobileSync.c +++ b/src/MobileSync.c @@ -51,7 +51,7 @@ iphone_error_t iphone_msync_new_client(iphone_device_t device, int src_port, int ret = iphone_msync_recv(client_loc, &array); plist_t msg_node = - plist_find_node(array, PLIST_STRING, "DLMessageVersionExchange", strlen("DLMessageVersionExchange")); + plist_find_node_by_string(array, "DLMessageVersionExchange"); plist_t ver_1 = plist_get_next_sibling(msg_node); plist_t ver_2 = plist_get_next_sibling(ver_1); @@ -83,7 +83,7 @@ iphone_error_t iphone_msync_new_client(iphone_device_t device, int src_port, int ret = iphone_msync_recv(client_loc, &array); plist_t rep_node = - plist_find_node(array, PLIST_STRING, "DLMessageDeviceReady", strlen("DLMessageDeviceReady")); + plist_find_node_by_string(array, "DLMessageDeviceReady"); if (rep_node) { ret = IPHONE_E_SUCCESS; @@ -117,8 +117,10 @@ static void iphone_msync_stop_session(iphone_msync_client_t client) iphone_error_t iphone_msync_free_client(iphone_msync_client_t client) { - iphone_msync_stop_session(client); + if (!client) + return IPHONE_E_INVALID_ARG; + iphone_msync_stop_session(client); return iphone_mux_free_client(client->connection); } |