aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/chunkedcontent.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-04-01 14:26:53 +0200
committerGitHub Enterprise <[email protected]>2025-04-01 14:26:53 +0200
commitbbb7e0c77b9ed114baf428256f347631b3e1092c (patch)
tree3f0801d44f5383b2c00ce2c277286dca630ebe84 /src/zenutil/chunkedcontent.cpp
parentlogging improvement (#332) (diff)
downloadzen-bbb7e0c77b9ed114baf428256f347631b3e1092c.tar.xz
zen-bbb7e0c77b9ed114baf428256f347631b3e1092c.zip
verify that we can read input files that are only hashed (#333)
* output build and part details by default * output executable and version at start of builds command * verify that we can read files we do not chunk
Diffstat (limited to 'src/zenutil/chunkedcontent.cpp')
-rw-r--r--src/zenutil/chunkedcontent.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/zenutil/chunkedcontent.cpp b/src/zenutil/chunkedcontent.cpp
index 1e8447a57..32ae2d94a 100644
--- a/src/zenutil/chunkedcontent.cpp
+++ b/src/zenutil/chunkedcontent.cpp
@@ -140,8 +140,12 @@ namespace {
{
ZEN_TRACE_CPU("HashOnly");
- IoBuffer Buffer = IoBufferBuilder::MakeFromFile((FolderPath / Path).make_preferred());
- const IoHash Hash = IoHash::HashBuffer(Buffer, &Stats.BytesHashed);
+ IoBuffer Buffer = IoBufferBuilder::MakeFromFile((FolderPath / Path).make_preferred());
+ if (Buffer.GetSize() != RawSize)
+ {
+ throw std::runtime_error(fmt::format("Failed opening file '{}' for hashing", FolderPath / Path));
+ }
+ const IoHash Hash = IoHash::HashBuffer(Buffer, &Stats.BytesHashed);
Lock.WithExclusiveLock([&]() {
if (!RawHashToSequenceRawHashIndex.contains(Hash))