From 426be9666c460e2a26ab78de72f5c212cf6374f3 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:48:59 -0700 Subject: [PATCH] Reset the downloadedBytes and totalFileBytes in the OTAImageProgress params to 0 when we prepare for download for BDX (#28309) --- src/platform/Linux/OTAImageProcessorImpl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/Linux/OTAImageProcessorImpl.cpp b/src/platform/Linux/OTAImageProcessorImpl.cpp index 4b6695f1fe7d13..4647a0df69fba0 100644 --- a/src/platform/Linux/OTAImageProcessorImpl.cpp +++ b/src/platform/Linux/OTAImageProcessorImpl.cpp @@ -127,6 +127,8 @@ void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) unlink(imageProcessor->mImageFile); + imageProcessor->mParams.downloadedBytes = 0; + imageProcessor->mParams.totalFileBytes = 0; imageProcessor->mHeaderParser.Init(); imageProcessor->mOfs.open(imageProcessor->mImageFile, std::ofstream::out | std::ofstream::ate | std::ofstream::app); if (!imageProcessor->mOfs.good())