summaryrefslogtreecommitdiffstats
path: root/src/ipsw.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2024-07-09 11:45:10 +0200
committerGravatar Nikias Bassen2024-07-09 11:45:10 +0200
commitf7e24ce6e56d67c9889744bb270ad6a98fe653f5 (patch)
treec5efab823d457c484b4cb33d4ed020a9f4efaa07 /src/ipsw.h
parent26613f928cb32fa29e31310d0e330c9c3c32085c (diff)
downloadidevicerestore-f7e24ce6e56d67c9889744bb270ad6a98fe653f5.tar.gz
idevicerestore-f7e24ce6e56d67c9889744bb270ad6a98fe653f5.tar.bz2
ipsw: Fix concurrent access to ZIP fileHEADmaster
With the new AsyncDataRequestMsg we have the problem that multiple threads would access the .ipsw, however we were only using one struct zip* handle for the entire procedure, resulting in read errors when concurrent access occurs. This commit fixes it by opening the zip file for every access separately.
Diffstat (limited to 'src/ipsw.h')
-rw-r--r--src/ipsw.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ipsw.h b/src/ipsw.h
index f0e11a1..8cb2561 100644
--- a/src/ipsw.h
+++ b/src/ipsw.h
@@ -33,7 +33,7 @@ extern "C" {
#include <sys/stat.h>
struct ipsw_archive {
- struct zip* zip;
+ int zip;
char *path;
};
typedef struct ipsw_archive* ipsw_archive_t;
@@ -48,6 +48,7 @@ typedef int (*ipsw_send_cb)(void *ctx, void *data, size_t size, size_t done, siz
struct ipsw_file_handle {
FILE* file;
+ struct zip* zip;
struct zip_file* zfile;
uint64_t size;
int seekable;