Skip to content

Commit eda43ac

Browse files
committed
Fix progress bar for DFU/Recovery image upload
1 parent a0cec3b commit eda43ac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dfu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ int dfu_client_new(struct idevicerestore_client_t* client)
6161

6262
irecv_event_subscribe(dfu, IRECV_PROGRESS, &dfu_progress_callback, NULL);
6363
client->dfu->client = dfu;
64-
register_progress('DFUP', "Uploading");
6564
return 0;
6665
}
6766

@@ -200,7 +199,9 @@ int dfu_send_component(struct idevicerestore_client_t* client, plist_t build_ide
200199

201200
logger(LL_INFO, "Sending %s (%zu bytes)...\n", component, size);
202201

202+
register_progress('DFUP', "Uploading");
203203
irecv_error_t err = irecv_send_buffer(client->dfu->client, data, size, IRECV_SEND_OPT_DFU_NOTIFY_FINISH);
204+
finalize_progress('DFUP');
204205
if (err != IRECV_E_SUCCESS) {
205206
logger(LL_ERROR, "Unable to send %s component: %s\n", component, irecv_strerror(err));
206207
free(data);

src/recovery.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ int recovery_client_new(struct idevicerestore_client_t* client)
9999
}
100100

101101
irecv_event_subscribe(recovery, IRECV_PROGRESS, &recovery_progress_callback, NULL);
102-
register_progress('RECV', "Uploading");
103102
client->recovery->client = recovery;
104103
return 0;
105104
}
@@ -317,8 +316,10 @@ int recovery_send_component(struct idevicerestore_client_t* client, plist_t buil
317316
logger(LL_INFO, "Sending %s (%zu bytes)...\n", component, size);
318317

319318
// FIXME: Did I do this right????
319+
register_progress('RECV', "Uploading");
320320
err = irecv_send_buffer(client->recovery->client, data, size, 0);
321321
free(data);
322+
finalize_progress('RECV');
322323
if (err != IRECV_E_SUCCESS) {
323324
logger(LL_ERROR, "Unable to send %s component: %s\n", component, irecv_strerror(err));
324325
return -1;

0 commit comments

Comments
 (0)