aboutsummaryrefslogtreecommitdiff
path: root/src/engine/plan.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/engine/plan.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp
index 55fe7ddf..8421d87b 100644
--- a/src/engine/plan.cpp
+++ b/src/engine/plan.cpp
@@ -431,6 +431,7 @@ extern "C" HRESULT PlanLayoutBundle(
431 pCacheAction->bundleLayout.qwBundleSize = qwBundleSize; 431 pCacheAction->bundleLayout.qwBundleSize = qwBundleSize;
432 pCacheAction->bundleLayout.pPayloadGroup = pLayoutPayloads; 432 pCacheAction->bundleLayout.pPayloadGroup = pLayoutPayloads;
433 433
434 // Acquire + Verify
434 pPlan->qwCacheSizeTotal += 2 * qwBundleSize; 435 pPlan->qwCacheSizeTotal += 2 * qwBundleSize;
435 436
436 ++pPlan->cOverallProgressTicksTotal; 437 ++pPlan->cOverallProgressTicksTotal;
@@ -1005,6 +1006,7 @@ extern "C" HRESULT PlanLayoutContainer(
1005 pCacheAction->type = BURN_CACHE_ACTION_TYPE_CONTAINER; 1006 pCacheAction->type = BURN_CACHE_ACTION_TYPE_CONTAINER;
1006 pCacheAction->container.pContainer = pContainer; 1007 pCacheAction->container.pContainer = pContainer;
1007 1008
1009 // Acquire + Verify
1008 pPlan->qwCacheSizeTotal += 2 * pContainer->qwFileSize; 1010 pPlan->qwCacheSizeTotal += 2 * pContainer->qwFileSize;
1009 } 1011 }
1010 } 1012 }
@@ -1012,11 +1014,9 @@ extern "C" HRESULT PlanLayoutContainer(
1012 { 1014 {
1013 if (!pContainer->fActuallyAttached) 1015 if (!pContainer->fActuallyAttached)
1014 { 1016 {
1017 // Acquire
1015 pPlan->qwCacheSizeTotal += pContainer->qwFileSize; 1018 pPlan->qwCacheSizeTotal += pContainer->qwFileSize;
1016 } 1019 }
1017
1018 // TODO: This should be the sum of all uncompressed payloads in the container, ideally restricted to the payloads that were actually planned.
1019 pPlan->qwCacheSizeTotal += pContainer->qwFileSize;
1020 } 1020 }
1021 1021
1022 if (!pContainer->sczUnverifiedPath) 1022 if (!pContainer->sczUnverifiedPath)
@@ -1829,6 +1829,8 @@ static void ResetPlannedContainerState(
1829 ) 1829 )
1830{ 1830{
1831 pContainer->fPlanned = FALSE; 1831 pContainer->fPlanned = FALSE;
1832 pContainer->qwExtractSizeTotal = 0;
1833 pContainer->qwCommittedCacheProgress = 0;
1832} 1834}
1833 1835
1834static void ResetPlannedPayloadsState( 1836static void ResetPlannedPayloadsState(
@@ -2246,9 +2248,17 @@ static HRESULT ProcessPayloadGroup(
2246 2248
2247 if (!pPlan->sczLayoutDirectory || !pPayload->pContainer) 2249 if (!pPlan->sczLayoutDirectory || !pPayload->pContainer)
2248 { 2250 {
2251 // Acquire + Verify
2249 pPlan->qwCacheSizeTotal += 2 * pPayload->qwFileSize; 2252 pPlan->qwCacheSizeTotal += 2 * pPayload->qwFileSize;
2250 } 2253 }
2251 2254
2255 if (!pPlan->sczLayoutDirectory && pPayload->pContainer && 1 == pPayload->cRemainingInstances)
2256 {
2257 // Extract
2258 pPlan->qwCacheSizeTotal += pPayload->qwFileSize;
2259 pPayload->pContainer->qwExtractSizeTotal += pPayload->qwFileSize;
2260 }
2261
2252 if (!pPayload->sczUnverifiedPath) 2262 if (!pPayload->sczUnverifiedPath)
2253 { 2263 {
2254 hr = CacheCalculatePayloadWorkingPath(pPlan->wzBundleId, pPayload, &pPayload->sczUnverifiedPath); 2264 hr = CacheCalculatePayloadWorkingPath(pPlan->wzBundleId, pPayload, &pPayload->sczUnverifiedPath);