From 4926ba7c4d7291e5d8f873e69f39e6e5840f48b0 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Fri, 29 Oct 2021 15:04:50 +0200 Subject: Fixed up Windows-specific include statements --- zenserver/testing/launch.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 55695ac9c..1f38257e5 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -9,17 +9,21 @@ #include #include #include -#include #include -#include -#include -#include - -#include -#pragma comment(lib, "UserEnv.lib") +#if ZEN_PLATFORM_WINDOWS +# include + +ZEN_THIRD_PARTY_INCLUDES_START +# include +# include +# include +# include +# include +ZEN_THIRD_PARTY_INCLUDES_END +# pragma comment(lib, "UserEnv.lib") +#endif -#include #include #include -- cgit v1.2.3 From a0bd0821e7a23f1ff3476151c0702be3691dc582 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Fri, 29 Oct 2021 15:10:28 +0200 Subject: CAS.cpp/h -> cas.cpp/h to keep Zen's file casing consistent --- zenserver/testing/launch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 1f38257e5..96f01576c 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #if ZEN_PLATFORM_WINDOWS # include -- cgit v1.2.3 From 9d37d2c61bd2399e67ebc3c49830221d2148c9ed Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Fri, 29 Oct 2021 15:46:30 +0200 Subject: Fixed warnings about unhandled switch cases --- zenserver/testing/launch.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 96f01576c..4b0a76246 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -340,6 +340,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat case HttpVerb::kPost: break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -366,6 +369,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat Job.SpawnJob("c:\\windows\\system32\\cmd.exe"); } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); @@ -417,6 +423,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat return HttpReq.WriteResponse(HttpResponseCode::OK, Response); } break; + + default: + break; } }, HttpVerb::kPost); @@ -500,6 +509,9 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat return HttpReq.WriteResponse(HttpResponseCode::OK, Response.Save()); } break; + + default: + break; } }, HttpVerb::kGet | HttpVerb::kPost); -- cgit v1.2.3 From 4fa9380f0d40a55a8f3df32a46d60102483d9057 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Fri, 29 Oct 2021 15:48:22 +0200 Subject: If-def'd Basic and SandboxedJob classes temporarily --- zenserver/testing/launch.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 4b0a76246..569bf99e0 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -31,6 +31,7 @@ using namespace std::literals; namespace zen { +#if ZEN_PLATFORM_WINDOWS struct BasicJob { public: @@ -130,7 +131,19 @@ BasicJob::ExitCode() return gsl::narrow_cast(Ec); } +#else + struct BasicJob + { + void SetWorkingDirectory(...); + void SpawnJob(...); + void Wait(); + int32_t ExitCode(); + }; +#endif // ZEN_PLATFORM_WINDOWS + +//////////////////////////////////////////////////////////////////////////////// +#if ZEN_PLATFORM_WINDOWS struct SandboxedJob { SandboxedJob() = default; @@ -320,6 +333,10 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath) return true; } +#else +#endif // ZEN_PLATFORM_WINDOWS + +//////////////////////////////////////////////////////////////////////////////// HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::path& SandboxBaseDir) : m_Log(logging::Get("exec")) -- cgit v1.2.3 From 55a0f5047c069c82e741ecc917e65827377fcda9 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 3 Nov 2021 09:25:09 +0100 Subject: Wrapped /apply/ and /exec/ services in a ZEN_WITH_COMPUTE_SERVICES define --- zenserver/testing/launch.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 569bf99e0..8e58b481e 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -2,6 +2,8 @@ #include "launch.h" +#if ZEN_WITH_COMPUTE_SERVICES + #include #include #include @@ -563,3 +565,5 @@ HttpLaunchService::CreateNewSandbox() } } // namespace zen + +#endif // ZEN_WITH_COMPUTE_SERVICES -- cgit v1.2.3 From 30d1beba4d8ab3db48fd7bf8d6cc63d565c20e9c Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Wed, 3 Nov 2021 09:25:54 +0100 Subject: Removed if-def ZEN_PLATFORM_WINDOWS as its covered by WITH_COMPUTE now --- zenserver/testing/launch.cpp | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'zenserver/testing/launch.cpp') diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index 8e58b481e..013aa28b8 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -11,20 +11,17 @@ #include #include #include +#include #include -#if ZEN_PLATFORM_WINDOWS -# include - ZEN_THIRD_PARTY_INCLUDES_START -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include ZEN_THIRD_PARTY_INCLUDES_END -# pragma comment(lib, "UserEnv.lib") -#endif +#pragma comment(lib, "UserEnv.lib") #include #include @@ -33,7 +30,6 @@ using namespace std::literals; namespace zen { -#if ZEN_PLATFORM_WINDOWS struct BasicJob { public: @@ -133,19 +129,9 @@ BasicJob::ExitCode() return gsl::narrow_cast(Ec); } -#else - struct BasicJob - { - void SetWorkingDirectory(...); - void SpawnJob(...); - void Wait(); - int32_t ExitCode(); - }; -#endif // ZEN_PLATFORM_WINDOWS //////////////////////////////////////////////////////////////////////////////// -#if ZEN_PLATFORM_WINDOWS struct SandboxedJob { SandboxedJob() = default; @@ -335,8 +321,6 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath) return true; } -#else -#endif // ZEN_PLATFORM_WINDOWS //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3