diff options
| author | Dan Engelbrecht <[email protected]> | 2022-06-08 20:03:55 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-06-08 20:03:55 +0200 |
| commit | b7a4235f84a1607be2c95bed48d48b010fad263a (patch) | |
| tree | 35858149b3ee02cd5a8b122c09147321d4751f85 | |
| parent | Update README.md (diff) | |
| parent | Enable adding namespace to URI based upstream requests (diff) | |
| download | zen-b7a4235f84a1607be2c95bed48d48b010fad263a.tar.xz zen-b7a4235f84a1607be2c95bed48d48b010fad263a.zip | |
Merge pull request #126 from EpicGames/de/remove-namespace-hack-for-zen-upstream
Enable adding namespace to URI based upstream requests
| -rw-r--r-- | zenserver/upstream/zen.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/zenserver/upstream/zen.cpp b/zenserver/upstream/zen.cpp index 0237ec346..cd6a531ca 100644 --- a/zenserver/upstream/zen.cpp +++ b/zenserver/upstream/zen.cpp @@ -408,15 +408,14 @@ ZenStructuredCacheSession::CheckHealth() } ZenCacheResult -ZenStructuredCacheSession::GetCacheRecord(std::string_view, std::string_view BucketId, const IoHash& Key, ZenContentType Type) +ZenStructuredCacheSession::GetCacheRecord(std::string_view Namespace, std::string_view BucketId, const IoHash& Key, ZenContentType Type) { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); @@ -438,15 +437,17 @@ ZenStructuredCacheSession::GetCacheRecord(std::string_view, std::string_view Buc } ZenCacheResult -ZenStructuredCacheSession::GetCacheValue(std::string_view, std::string_view BucketId, const IoHash& Key, const IoHash& ValueContentId) +ZenStructuredCacheSession::GetCacheValue(std::string_view Namespace, + std::string_view BucketId, + const IoHash& Key, + const IoHash& ValueContentId) { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString() << "/" << ValueContentId.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); @@ -473,7 +474,7 @@ ZenStructuredCacheSession::GetCacheValue(std::string_view, std::string_view Buck } ZenCacheResult -ZenStructuredCacheSession::PutCacheRecord(std::string_view, +ZenStructuredCacheSession::PutCacheRecord(std::string_view Namespace, std::string_view BucketId, const IoHash& Key, IoBuffer Value, @@ -481,11 +482,10 @@ ZenStructuredCacheSession::PutCacheRecord(std::string_view, { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); @@ -510,7 +510,7 @@ ZenStructuredCacheSession::PutCacheRecord(std::string_view, } ZenCacheResult -ZenStructuredCacheSession::PutCacheValue(std::string_view, +ZenStructuredCacheSession::PutCacheValue(std::string_view Namespace, std::string_view BucketId, const IoHash& Key, const IoHash& ValueContentId, @@ -518,11 +518,10 @@ ZenStructuredCacheSession::PutCacheValue(std::string_view, { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString() << "/" << ValueContentId.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); |