diff options
Diffstat (limited to 'zenserver/projectstore.cpp')
| -rw-r--r-- | zenserver/projectstore.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp index 32592d7a8..b331f262a 100644 --- a/zenserver/projectstore.cpp +++ b/zenserver/projectstore.cpp @@ -73,8 +73,7 @@ struct ProjectStore::OplogStorage : public RefCounted [[nodiscard]] bool Exists() { return Exists(m_OplogStoragePath); } [[nodiscard]] static bool Exists(std::filesystem::path BasePath) { - return std::filesystem::exists(BasePath / "ops.zlog") && std::filesystem::exists(BasePath / "ops.zdb") && - std::filesystem::exists(BasePath / "ops.zops"); + return std::filesystem::exists(BasePath / "ops.zlog") && std::filesystem::exists(BasePath / "ops.zops"); } static bool Delete(std::filesystem::path BasePath) { return DeleteDirectories(BasePath); } @@ -692,6 +691,7 @@ ProjectStore::OpenProject(std::string_view ProjectId) Log().info("opening project {} @ {}", ProjectId, ProjectBasePath); ProjectStore::Project& Prj = m_Projects.try_emplace(std::string{ProjectId}, this, m_CasStore, ProjectBasePath).first->second; + Prj.Identifier = ProjectId; Prj.Read(); return &Prj; } @@ -849,7 +849,7 @@ HttpProjectService::HttpProjectService(CasStore& Store, ProjectStore* Projects) for (uint32_t ChunkIndex = 0; ChunkIndex < RequestHdr.ChunkCount; ++ChunkIndex) { const RequestChunkEntry& RequestedChunk = RequestedChunks[ChunkIndex]; - IoBuffer FoundChunk = FoundLog->FindChunk(RequestedChunk.ChunkId); + IoBuffer FoundChunk = FoundLog->FindChunk(RequestedChunk.ChunkId); if (FoundChunk) { if (RequestedChunk.Offset > 0 || RequestedChunk.RequestBytes < uint64_t(-1)) @@ -869,7 +869,7 @@ HttpProjectService::HttpProjectService(CasStore& Store, ProjectStore* Projects) } OutBlobs.emplace_back(std::move(FoundChunk)); } - uint8_t* ResponsePtr = reinterpret_cast<uint8_t*>(OutBlobs[0].MutableData()); + uint8_t* ResponsePtr = reinterpret_cast<uint8_t*>(OutBlobs[0].MutableData()); ResponseHeader ResponseHdr; ResponseHdr.ChunkCount = RequestHdr.ChunkCount; memcpy(ResponsePtr, &ResponseHdr, sizeof(ResponseHdr)); @@ -877,8 +877,8 @@ HttpProjectService::HttpProjectService(CasStore& Store, ProjectStore* Projects) for (uint32_t ChunkIndex = 0; ChunkIndex < RequestHdr.ChunkCount; ++ChunkIndex) { const RequestChunkEntry& RequestedChunk = RequestedChunks[ChunkIndex]; - const IoBuffer& FoundChunk(OutBlobs[ChunkIndex + 1]); - ResponseChunkEntry ResponseChunk; + const IoBuffer& FoundChunk(OutBlobs[ChunkIndex + 1]); + ResponseChunkEntry ResponseChunk; ResponseChunk.CorrelationId = ChunkIndex; if (FoundChunk) { @@ -891,7 +891,7 @@ HttpProjectService::HttpProjectService(CasStore& Store, ProjectStore* Projects) memcpy(ResponsePtr, &ResponseChunk, sizeof(ResponseChunk)); ResponsePtr += sizeof(ResponseChunk); } - + return HttpReq.WriteResponse(HttpResponse::OK, HttpContentType::kBinary, OutBlobs); }, HttpVerb::kPost); |