From f7e24ce6e56d67c9889744bb270ad6a98fe653f5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 9 Jul 2024 11:45:10 +0200 Subject: ipsw: Fix concurrent access to ZIP file 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. --- src/ipsw.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ipsw.h') 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 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; -- cgit v1.1-32-gdbae