aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/storage/objectstore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-04-13 12:42:58 +0200
committerGitHub Enterprise <[email protected]>2026-04-13 12:42:58 +0200
commit2d902f99fbfc11b874f4c50fa648f10340e4f0cc (patch)
tree8767ab7079bdc4a2f07c3ddee2a8051b0b5e218e /src/zenserver/storage/objectstore
parentLogging and diagnostics improvements (#941) (diff)
downloadzen-2d902f99fbfc11b874f4c50fa648f10340e4f0cc.tar.xz
zen-2d902f99fbfc11b874f4c50fa648f10340e4f0cc.zip
minor fixups (#948)
* objectstore.cpp - m_TotalBytesServed now tracks all range cases (single, multi, 416) * async http: docstring corrected: curl_multi_socket_action() / ASIO socket async_wait remove non-ascii characters * fix singlethreaded gc option in lua to not use dash * fix changelog order
Diffstat (limited to 'src/zenserver/storage/objectstore')
-rw-r--r--src/zenserver/storage/objectstore/objectstore.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/zenserver/storage/objectstore/objectstore.cpp b/src/zenserver/storage/objectstore/objectstore.cpp
index bab9df06d..1115c1cd6 100644
--- a/src/zenserver/storage/objectstore/objectstore.cpp
+++ b/src/zenserver/storage/objectstore/objectstore.cpp
@@ -669,24 +669,39 @@ HttpObjectStoreService::GetObject(HttpRouterRequest& Request, const std::string_
NiceBytes(FileBuf.GetSize()),
NiceBytes(TotalServed));
}
- else if (Ranges.size() == 1)
+ else
{
- const uint64_t TotalSize = FileBuf.GetSize();
- const uint64_t RangeEnd = (Ranges[0].End != ~uint64_t(0)) ? Ranges[0].End : TotalSize - 1;
- if (RangeEnd < TotalSize && Ranges[0].Start <= RangeEnd)
+ const uint64_t TotalSize = FileBuf.GetSize();
+ uint64_t ServedBytes = 0;
+ for (const HttpRange& Range : Ranges)
{
- const uint64_t RangeSize = 1 + (RangeEnd - Ranges[0].Start);
- const uint64_t TotalServed = m_TotalBytesServed.fetch_add(RangeSize) + RangeSize;
+ const uint64_t RangeEnd = (Range.End != ~uint64_t(0)) ? Range.End : TotalSize - 1;
+ if (RangeEnd < TotalSize && Range.Start <= RangeEnd)
+ {
+ ServedBytes += 1 + (RangeEnd - Range.Start);
+ }
+ }
+ if (ServedBytes > 0)
+ {
+ const uint64_t TotalServed = m_TotalBytesServed.fetch_add(ServedBytes) + ServedBytes;
ZEN_LOG_DEBUG(LogObj,
- "GET - '{}/{}' (Range: {}-{}) ({}/{}) [OK] (Served: {})",
+ "GET - '{}/{}' (Ranges: {}) ({}/{}) [OK] (Served: {})",
BucketName,
RelativeBucketPath,
- Ranges[0].Start,
- RangeEnd,
- NiceBytes(RangeSize),
+ Ranges.size(),
+ NiceBytes(ServedBytes),
NiceBytes(TotalSize),
NiceBytes(TotalServed));
}
+ else
+ {
+ ZEN_LOG_DEBUG(LogObj,
+ "GET - '{}/{}' (Ranges: {}) [416] ({})",
+ BucketName,
+ RelativeBucketPath,
+ Ranges.size(),
+ NiceBytes(TotalSize));
+ }
}
Request.ServerRequest().WriteResponse(HttpContentType::kBinary, FileBuf, Ranges);
}