aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-13 21:42:17 +0200
committerStefan Boberg <[email protected]>2021-09-13 21:42:17 +0200
commit99abde4e3b34ee588a567c480f1f6a784e8a8fe4 (patch)
treecb5a65f64d4d082131d81bd1ec97e2984b131567
parentMoved some shared http definitions into httpcommon.h (diff)
downloadzen-99abde4e3b34ee588a567c480f1f6a784e8a8fe4.tar.xz
zen-99abde4e3b34ee588a567c480f1f6a784e8a8fe4.zip
Changed explicit http status checking into IsHttpSuccessCode() call
-rw-r--r--zen/cmds/cache.cpp3
-rw-r--r--zen/zen.vcxproj3
2 files changed, 5 insertions, 1 deletions
diff --git a/zen/cmds/cache.cpp b/zen/cmds/cache.cpp
index a9d017a2b..3f4a4cdc3 100644
--- a/zen/cmds/cache.cpp
+++ b/zen/cmds/cache.cpp
@@ -3,6 +3,7 @@
#include "cache.h"
#include <zencore/filesystem.h>
+#include <zenhttp/httpcommon.h>
#include <zenserverprocess.h>
#include <spdlog/spdlog.h>
@@ -44,7 +45,7 @@ DropCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
Session.SetUrl({"{}/z$/{}"_format(m_HostName, m_BucketName)});
cpr::Response Result = Session.Delete();
- if (Result.status_code >= 200 && Result.status_code < 300)
+ if (zen::IsHttpSuccessCode(Result.status_code))
{
spdlog::info("OK: dropped cache bucket '{}' from '{}'", m_BucketName, m_HostName);
diff --git a/zen/zen.vcxproj b/zen/zen.vcxproj
index 322b70850..4f0691fab 100644
--- a/zen/zen.vcxproj
+++ b/zen/zen.vcxproj
@@ -124,6 +124,9 @@
<ProjectReference Include="..\zencore\zencore.vcxproj">
<Project>{d75bf9ab-c61e-4fff-ad59-1563430f05e2}</Project>
</ProjectReference>
+ <ProjectReference Include="..\zenhttp\zenhttp.vcxproj">
+ <Project>{8eeb3be5-7001-46bf-aafd-edb7558ac012}</Project>
+ </ProjectReference>
<ProjectReference Include="..\zenstore\zenstore.vcxproj">
<Project>{26cbbaeb-14c1-4efc-877d-80f48215651c}</Project>
</ProjectReference>