diff options
author | Martin Szulecki | 2010-01-25 15:44:32 +0100 |
---|---|---|
committer | Martin Szulecki | 2010-01-25 15:44:32 +0100 |
commit | de9b690877c4581a4e846743efa26aa75759d074 (patch) | |
tree | 62f93c0e42241eb22260e9b693592534a87d67ce | |
parent | 34a4e3e15cb30b1e786776695f96e5f0352b3c2e (diff) | |
download | libimobiledevice-de9b690877c4581a4e846743efa26aa75759d074.tar.gz libimobiledevice-de9b690877c4581a4e846743efa26aa75759d074.tar.bz2 |
Also count received hunks so the total backup size message appears once
-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[]) /* receive and save DLSendFile files and metadata, ACK each */ int file_index = 0; + int hunk_index = 0; uint64_t backup_real_size = 0; char *file_path = NULL; char *file_ext = NULL; @@ -442,8 +443,8 @@ int main(int argc, char *argv[]) node_tmp = plist_array_get_item(message, 2); - /* first message contains total backup size */ - if (file_index == 0) { + /* first message hunk contains total backup size */ + if (hunk_index == 0) { node = plist_dict_get_item(node_tmp, "BackupTotalSizeKey"); if (node) { plist_get_uint_val(node, &backup_total_size); @@ -533,6 +534,8 @@ int main(int argc, char *argv[]) printf("DONE\n"); } + hunk_index++; + if (file_ext) free(file_ext); |