From e643ca2e62ce5ecd2604afa51cb4d131bc76afa2 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 20 Aug 2024 14:14:42 +0200 Subject: close payload file if size mismatch for file cas (#128) --- src/zenstore/filecas.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp index b3cdafd4e..48177ac9e 100644 --- a/src/zenstore/filecas.cpp +++ b/src/zenstore/filecas.cpp @@ -601,10 +601,10 @@ FileCasStrategy::InsertChunkData(const void* const ChunkData, const size_t Chunk Name.ShardedPath.ToUtf8(), ChunkSize, FileSize); + PayloadFile.Close(); } } - - if ((hRes != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) && (hRes != HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND))) + else if ((hRes != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) && (hRes != HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND))) { ZEN_WARN("Unexpected error code when opening shard file for read: {:#x}", uint32_t(hRes)); } -- cgit v1.2.3