diff options
| -rw-r--r-- | include/libimobiledevice/mobilebackup2.h | 1 | ||||
| -rw-r--r-- | src/mobilebackup2.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/libimobiledevice/mobilebackup2.h b/include/libimobiledevice/mobilebackup2.h index 5d695e9..6557f42 100644 --- a/include/libimobiledevice/mobilebackup2.h +++ b/include/libimobiledevice/mobilebackup2.h | |||
| @@ -50,6 +50,7 @@ typedef mobilebackup2_client_private *mobilebackup2_client_t; /**< The client ha | |||
| 50 | 50 | ||
| 51 | mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, uint16_t port, mobilebackup2_client_t * client); | 51 | mobilebackup2_error_t mobilebackup2_client_new(idevice_t device, uint16_t port, mobilebackup2_client_t * client); |
| 52 | mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client); | 52 | mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client); |
| 53 | mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options); | ||
| 53 | mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage); | 54 | mobilebackup2_error_t mobilebackup2_receive_message(mobilebackup2_client_t client, plist_t *msg_plist, char **dlmessage); |
| 54 | mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes); | 55 | mobilebackup2_error_t mobilebackup2_send_raw(mobilebackup2_client_t client, const char *data, uint32_t length, uint32_t *bytes); |
| 55 | mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes); | 56 | mobilebackup2_error_t mobilebackup2_receive_raw(mobilebackup2_client_t client, char *data, uint32_t length, uint32_t *bytes); |
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c index c16da9a..1e39efa 100644 --- a/src/mobilebackup2.c +++ b/src/mobilebackup2.c | |||
| @@ -135,7 +135,7 @@ mobilebackup2_error_t mobilebackup2_client_free(mobilebackup2_client_t client) | |||
| 135 | * will be inserted into this plist before sending it. This parameter | 135 | * will be inserted into this plist before sending it. This parameter |
| 136 | * can be NULL if message is not NULL. | 136 | * can be NULL if message is not NULL. |
| 137 | */ | 137 | */ |
| 138 | static mobilebackup2_error_t internal_mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options) | 138 | mobilebackup2_error_t mobilebackup2_send_message(mobilebackup2_client_t client, const char *message, plist_t options) |
| 139 | { | 139 | { |
| 140 | if (!client || !client->parent || (!message && !options)) | 140 | if (!client || !client->parent || (!message && !options)) |
| 141 | return MOBILEBACKUP2_E_INVALID_ARG; | 141 | return MOBILEBACKUP2_E_INVALID_ARG; |
| @@ -368,7 +368,7 @@ mobilebackup2_error_t mobilebackup2_version_exchange(mobilebackup2_client_t clie | |||
| 368 | } | 368 | } |
| 369 | plist_dict_insert_item(dict, "SupportedProtocolVersions", array); | 369 | plist_dict_insert_item(dict, "SupportedProtocolVersions", array); |
| 370 | 370 | ||
| 371 | mobilebackup2_error_t err = internal_mobilebackup2_send_message(client, "Hello", dict); | 371 | mobilebackup2_error_t err = mobilebackup2_send_message(client, "Hello", dict); |
| 372 | plist_free(dict); | 372 | plist_free(dict); |
| 373 | 373 | ||
| 374 | if (err != MOBILEBACKUP2_E_SUCCESS) | 374 | if (err != MOBILEBACKUP2_E_SUCCESS) |
| @@ -438,7 +438,7 @@ mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, | |||
| 438 | if (options) { | 438 | if (options) { |
| 439 | plist_dict_insert_item(dict, "Options", plist_copy(options)); | 439 | plist_dict_insert_item(dict, "Options", plist_copy(options)); |
| 440 | } | 440 | } |
| 441 | mobilebackup2_error_t err = internal_mobilebackup2_send_message(client, request, dict); | 441 | mobilebackup2_error_t err = mobilebackup2_send_message(client, request, dict); |
| 442 | plist_free(dict); | 442 | plist_free(dict); |
| 443 | 443 | ||
| 444 | return err; | 444 | return err; |
