diff options
| author | 2010-01-25 15:44:32 +0100 | |
|---|---|---|
| committer | 2010-01-25 15:44:32 +0100 | |
| commit | de9b690877c4581a4e846743efa26aa75759d074 (patch) | |
| tree | 62f93c0e42241eb22260e9b693592534a87d67ce /tools/iphonebackup.c | |
| parent | 34a4e3e15cb30b1e786776695f96e5f0352b3c2e (diff) | |
| download | libimobiledevice-de9b690877c4581a4e846743efa26aa75759d074.tar.gz libimobiledevice-de9b690877c4581a4e846743efa26aa75759d074.tar.bz2 | |
Also count received hunks so the total backup size message appears once
Diffstat (limited to 'tools/iphonebackup.c')
| -rw-r--r-- | tools/iphonebackup.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c index d444e9b..c0f2276 100644 --- a/tools/iphonebackup.c +++ b/tools/iphonebackup.c | |||
| @@ -425,6 +425,7 @@ int main(int argc, char *argv[]) | |||
| 425 | 425 | ||
| 426 | /* receive and save DLSendFile files and metadata, ACK each */ | 426 | /* receive and save DLSendFile files and metadata, ACK each */ |
| 427 | int file_index = 0; | 427 | int file_index = 0; |
| 428 | int hunk_index = 0; | ||
| 428 | uint64_t backup_real_size = 0; | 429 | uint64_t backup_real_size = 0; |
| 429 | char *file_path = NULL; | 430 | char *file_path = NULL; |
| 430 | char *file_ext = NULL; | 431 | char *file_ext = NULL; |
| @@ -442,8 +443,8 @@ int main(int argc, char *argv[]) | |||
| 442 | 443 | ||
| 443 | node_tmp = plist_array_get_item(message, 2); | 444 | node_tmp = plist_array_get_item(message, 2); |
| 444 | 445 | ||
| 445 | /* first message contains total backup size */ | 446 | /* first message hunk contains total backup size */ |
| 446 | if (file_index == 0) { | 447 | if (hunk_index == 0) { |
| 447 | node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); | 448 | node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); |
| 448 | if (node) { | 449 | if (node) { |
| 449 | plist_get_uint_val(node, &backup_total_size); | 450 | plist_get_uint_val(node, &backup_total_size); |
| @@ -533,6 +534,8 @@ int main(int argc, char *argv[]) | |||
| 533 | printf("DONE\n"); | 534 | printf("DONE\n"); |
| 534 | } | 535 | } |
| 535 | 536 | ||
| 537 | hunk_index++; | ||
| 538 | |||
| 536 | if (file_ext) | 539 | if (file_ext) |
| 537 | free(file_ext); | 540 | free(file_ext); |
| 538 | 541 | ||
