From 6085ed7429986c7dec579fe1f1303ae6651ea1f2 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 9 Nov 2023 01:56:08 +0100 Subject: Print progress for large components (e.g. Cryptex) --- src/ipsw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ipsw.c') diff --git a/src/ipsw.c b/src/ipsw.c index 5b1d732..c25f61d 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -737,7 +737,7 @@ int ipsw_extract_send(ipsw_archive_t ipsw, const char* infile, int blocksize, ip // EOF break; } - if (send_callback(ctx, buffer, zr) < 0) { + if (send_callback(ctx, buffer, zr, done, total_size) < 0) { error("ERROR: %s: send failed\n", __func__); break; } @@ -773,7 +773,7 @@ int ipsw_extract_send(ipsw_archive_t ipsw, const char* infile, int blocksize, ip free(buffer); return -1; } - send_callback(ctx, buffer, (size_t)rl); + send_callback(ctx, buffer, (size_t)rl, 0, 0); } else { #endif FILE *f = fopen(filepath, "rb"); @@ -792,7 +792,7 @@ int ipsw_extract_send(ipsw_archive_t ipsw, const char* infile, int blocksize, ip error("ERROR: %s: fread failed for %s: %s\n", __func__, filepath, strerror(errno)); break; } - if (send_callback(ctx, buffer, fr) < 0) { + if (send_callback(ctx, buffer, fr, done, total_size) < 0) { error("ERROR: %s: send failed\n", __func__); break; } @@ -812,7 +812,7 @@ int ipsw_extract_send(ipsw_archive_t ipsw, const char* infile, int blocksize, ip } // send a NULL buffer to mark end of transfer - send_callback(ctx, NULL, 0); + send_callback(ctx, NULL, 0, done, total_size); return 0; } -- cgit v1.1-32-gdbae