From 68e08c82e0ec549ce491786a95914d478d864c89 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 17 Jul 2012 18:49:28 +0200 Subject: asr: implemented checksumming for filesystem upload --- src/restore.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/restore.c') diff --git a/src/restore.c b/src/restore.c index c1d5e25..25d51f6 100644 --- a/src/restore.c +++ b/src/restore.c @@ -640,7 +640,7 @@ int restore_send_filesystem(idevice_t device, const char* filesystem) { int i = 0; FILE* file = NULL; plist_t data = NULL; - idevice_connection_t asr = NULL; + asr_client_t asr = NULL; idevice_error_t device_error = IDEVICE_E_UNKNOWN_ERROR; info("About to send filesystem...\n"); @@ -651,20 +651,12 @@ int restore_send_filesystem(idevice_t device, const char* filesystem) { } info("Connected to ASR\n"); - /* receive Initiate command message */ - if (asr_receive(asr, &data) < 0) { - error("ERROR: Unable to receive data from ASR\n"); - asr_close(asr); - return -1; - } - plist_free(data); - // this step sends requested chunks of data from various offsets to asr so // it can validate the filesystem before installing it info("Validating the filesystem\n"); if (asr_perform_validation(asr, filesystem) < 0) { error("ERROR: ASR was unable to validate the filesystem\n"); - asr_close(asr); + asr_free(asr); return -1; } info("Filesystem validated\n"); @@ -674,12 +666,12 @@ int restore_send_filesystem(idevice_t device, const char* filesystem) { info("Sending filesystem now...\n"); if (asr_send_payload(asr, filesystem) < 0) { error("ERROR: Unable to send payload to ASR\n"); - asr_close(asr); + asr_free(asr); return -1; } info("Done sending filesystem\n"); - asr_close(asr); + asr_free(asr); return 0; } -- cgit v1.1-32-gdbae