diff options
Diffstat (limited to 'zenserver/compute/apply.cpp')
| -rw-r--r-- | zenserver/compute/apply.cpp | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp index 053c262c2..4a92b9968 100644 --- a/zenserver/compute/apply.cpp +++ b/zenserver/compute/apply.cpp @@ -2,6 +2,8 @@ #include "apply.h" +#if ZEN_WITH_COMPUTE_SERVICES + #include <zencore/compactbinary.h> #include <zencore/compactbinarybuilder.h> #include <zencore/compactbinarypackage.h> @@ -12,20 +14,18 @@ #include <zencore/iobuffer.h> #include <zencore/iohash.h> #include <zencore/scopeguard.h> -#include <zencore/windows.h> -#include <zenstore/CAS.h> +#include <zenstore/cas.h> #include <zenstore/cidstore.h> -#if ZEN_PLATFORM_WINDOWS +#include <zencore/windows.h> ZEN_THIRD_PARTY_INCLUDES_START -# include <AccCtrl.h> -# include <AclAPI.h> -# include <sddl.h> -# include <UserEnv.h> -# pragma comment(lib, "UserEnv.lib") -# include <atlbase.h> +#include <AccCtrl.h> +#include <AclAPI.h> +#include <sddl.h> +#include <UserEnv.h> +#pragma comment(lib, "UserEnv.lib") +#include <atlbase.h> ZEN_THIRD_PARTY_INCLUDES_END -#endif #include <filesystem> #include <span> @@ -134,6 +134,8 @@ BasicFunctionJob::ExitCode() return gsl::narrow_cast<int>(Ec); } +//////////////////////////////////////////////////////////////////////////////// + struct SandboxedFunctionJob { SandboxedFunctionJob() = default; @@ -324,6 +326,8 @@ SandboxedFunctionJob::SpawnJob(std::filesystem::path ExePath) return true; } +//////////////////////////////////////////////////////////////////////////////// + HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, const std::filesystem::path& BaseDir) : m_Log(logging::Get("apply")) , m_CasStore(Store) @@ -434,6 +438,8 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, SharedBuffer Decompressed = DataView.Decompress(); const uint64_t DecompressedSize = DataView.GetRawSize(); + ZEN_UNUSED(DataHash); + TotalAttachmentBytes += DecompressedSize; ++AttachmentCount; @@ -464,9 +470,15 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, return HttpReq.WriteResponse(HttpResponseCode::NoContent); } break; + + default: + break; } } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -483,6 +495,9 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, case HttpVerb::kPost: break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -580,6 +595,8 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, const IoHash DataHash = Attachment.GetHash(); CompressedBuffer DataView = Attachment.AsCompressedBinary(); + ZEN_UNUSED(DataHash); + const uint64_t CompressedSize = DataView.GetCompressedSize(); TotalAttachmentBytes += CompressedSize; @@ -605,8 +622,14 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore, return HttpReq.WriteResponse(HttpResponseCode::OK, Output); } break; + + default: + break; } break; + + default: + break; } }, HttpVerb::kPost); @@ -844,3 +867,5 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action) } } // namespace zen + +#endif // ZEN_WITH_COMPUTE_SERVICES |