Skip to content

Commit

Permalink
Fix multiple file download for FSIM fdo.download
Browse files Browse the repository at this point in the history
Signed-off-by: Shrikant Temburwar <[email protected]>
  • Loading branch information
shrikant1407 committed Sep 17, 2024
1 parent 5ef94b1 commit 47fbcdc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions device_modules/fdo_sim/fdo_sim_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,12 @@ int fdo_sim_set_osi_write(size_t bin_len, uint8_t *bin_data)
goto end;
}

if (bytes_received == expected_len || !bin_len) {
// Entire file has been sent
bytes_received = 0;
if (!bin_len) {
if (!fdor_next(fdor)) {
LOG(LOG_ERROR, "Module fdo.download - Failed to read "
"fdo.download\n");
goto end;
}
result = FDO_SI_SUCCESS;
goto end;
}
Expand Down Expand Up @@ -406,6 +409,7 @@ int fdo_sim_set_osi_write(size_t bin_len, uint8_t *bin_data)
if (file_data) {
FSIMModuleFree(file_data);
}
bytes_received = 0;
}

result = fdo_sim_end(&fdor, &fdow, result, bin_data, NULL, 0, &hasmore,
Expand Down

0 comments on commit 47fbcdc

Please sign in to comment.