diff options
| author | Per Larsson <[email protected]> | 2021-12-09 17:02:21 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-12-09 17:02:21 +0100 |
| commit | 7232c5b126028ef859977d7a2a65fe9ca7b7300f (patch) | |
| tree | bfaa76f874ae65279b76f82a9eeb39075321b672 | |
| parent | Merged main. (diff) | |
| download | zen-7232c5b126028ef859977d7a2a65fe9ca7b7300f.tar.xz zen-7232c5b126028ef859977d7a2a65fe9ca7b7300f.zip | |
Format fix.
| -rw-r--r-- | zencore/include/zencore/iobuffer.h | 10 | ||||
| -rw-r--r-- | zencore/include/zencore/refcount.h | 5 | ||||
| -rw-r--r-- | zencore/iobuffer.cpp | 2 | ||||
| -rw-r--r-- | zenhttp/httpasio.cpp | 34 | ||||
| -rw-r--r-- | zenhttp/httpserver.cpp | 6 | ||||
| -rw-r--r-- | zenhttp/httpsys.cpp | 2 | ||||
| -rw-r--r-- | zenhttp/httpsys.h | 4 | ||||
| -rw-r--r-- | zenserver/cache/cachetracking.h | 4 | ||||
| -rw-r--r-- | zenserver/compute/apply.cpp | 5 | ||||
| -rw-r--r-- | zenserver/config.cpp | 10 | ||||
| -rw-r--r-- | zenstore/include/zenstore/caslog.h | 10 | ||||
| -rw-r--r-- | zenutil/zenserverprocess.cpp | 2 |
12 files changed, 44 insertions, 50 deletions
diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h index 9d18a55e9..012e9a9df 100644 --- a/zencore/include/zencore/iobuffer.h +++ b/zencore/include/zencore/iobuffer.h @@ -2,9 +2,9 @@ #pragma once -#include <atomic> #include <memory.h> #include <zencore/memory.h> +#include <atomic> #include "refcount.h" #include "zencore.h" @@ -208,11 +208,11 @@ public: inline uint32_t GetRefCount() const { return m_RefCount; } protected: - uint32_t m_RefCount = 0; + uint32_t m_RefCount = 0; mutable std::atomic<uint32_t> m_Flags{0}; - mutable const void* m_DataPtr = nullptr; - size_t m_DataBytes = 0; - RefPtr<const IoBufferCore> m_OuterCore; + mutable const void* m_DataPtr = nullptr; + size_t m_DataBytes = 0; + RefPtr<const IoBufferCore> m_OuterCore; enum { diff --git a/zencore/include/zencore/refcount.h b/zencore/include/zencore/refcount.h index 1873ce48e..7167ab3b5 100644 --- a/zencore/include/zencore/refcount.h +++ b/zencore/include/zencore/refcount.h @@ -117,9 +117,8 @@ public: inline ~Ref() { m_Ref && m_Ref->Release(); } template<typename DerivedType> - requires std::derived_from<DerivedType, T> inline Ref(const Ref<DerivedType>& Rhs) : Ref(Rhs.m_Ref) - { - } + requires std::derived_from<DerivedType, T> + inline Ref(const Ref<DerivedType>& Rhs) : Ref(Rhs.m_Ref) {} [[nodiscard]] inline bool IsNull() const { return m_Ref == nullptr; } inline explicit operator bool() const { return m_Ref != nullptr; } diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index e2c112a79..979772d5e 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -507,7 +507,7 @@ IoBufferBuilder::MakeFromTemporaryFile(const std::filesystem::path& FileName) Handle = DataFile.Detach(); #else - int Fd = open(FileName.native().c_str(), O_RDONLY); + int Fd = open(FileName.native().c_str(), O_RDONLY); if (Fd < 0) { return {}; diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp index 7ee7193d1..08cefc3bc 100644 --- a/zenhttp/httpasio.cpp +++ b/zenhttp/httpasio.cpp @@ -18,9 +18,9 @@ ZEN_THIRD_PARTY_INCLUDES_END #define ASIO_VERBOSE_TRACE 0 #if ASIO_VERBOSE_TRACE -#define ZEN_TRACE_VERBOSE ZEN_TRACE +# define ZEN_TRACE_VERBOSE ZEN_TRACE #else -#define ZEN_TRACE_VERBOSE(fmtstr, ...) +# define ZEN_TRACE_VERBOSE(fmtstr, ...) #endif namespace zen::asio_http { @@ -403,10 +403,10 @@ HttpServerConnection::OnDataReceived(const asio::error_code& Ec, [[maybe_unused] } ZEN_TRACE_VERBOSE("on data received, connection '{}', request '{}', thread '{}', bytes '{}'", - m_ConnectionId, - m_RequestCounter.load(std::memory_order_relaxed), - GetCurrentThreadId(), - NiceBytes(ByteCount)); + m_ConnectionId, + m_RequestCounter.load(std::memory_order_relaxed), + GetCurrentThreadId(), + NiceBytes(ByteCount)); while (m_RequestBuffer.size()) { @@ -441,10 +441,10 @@ HttpServerConnection::OnResponseDataSent(const asio::error_code& Ec, [[maybe_unu else { ZEN_TRACE_VERBOSE("on data sent, connection '{}', request '{}', thread '{}', bytes '{}'", - m_ConnectionId, - m_RequestCounter.load(std::memory_order_relaxed), - GetCurrentThreadId(), - NiceBytes(ByteCount)); + m_ConnectionId, + m_RequestCounter.load(std::memory_order_relaxed), + GetCurrentThreadId(), + NiceBytes(ByteCount)); if (!m_RequestData.IsKeepAlive()) { @@ -495,7 +495,6 @@ HttpServerConnection::HandleRequest() { HttpAsioServerRequest Request(m_RequestData, *Service, m_RequestData.Body()); - ZEN_TRACE_VERBOSE("handle request, connection '{}' request '{}'", m_ConnectionId, m_RequestCounter.load(std::memory_order_relaxed)); if (!HandlePackageOffers(*Service, Request, m_PackageHandler)) @@ -510,7 +509,6 @@ HttpServerConnection::HandleRequest() Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, ex.what()); } - } if (std::unique_ptr<HttpResponse> Response = std::move(Request.m_Response)) @@ -767,7 +765,7 @@ NormalizeUrlPath(const char* Url, size_t UrlLength, std::string& NormalizedUrl) bool LastCharWasSeparator = false; for (std::string_view::size_type UrlIndex = 0; UrlIndex < UrlLength; ++UrlIndex) { - const char UrlChar = Url[UrlIndex]; + const char UrlChar = Url[UrlIndex]; const bool IsSeparator = (UrlChar == '/'); if (IsSeparator && LastCharWasSeparator) @@ -860,7 +858,6 @@ HttpRequest::OnHeadersComplete() NormalizeUrlPath(m_Url, m_UrlLength, m_NormalizedUrl); - return 0; } @@ -1172,18 +1169,17 @@ HttpAsioServerImpl::RouteRequest(std::string_view Url) { RwLock::SharedLockScope _(m_Lock); - HttpService* CandidateService = nullptr; + HttpService* CandidateService = nullptr; std::string::size_type CandidateMatchSize = 0; for (const ServiceEntry& SvcEntry : m_UriHandlers) { - const std::string& SvcUrl = SvcEntry.ServiceUrlPath; + const std::string& SvcUrl = SvcEntry.ServiceUrlPath; const std::string::size_type SvcUrlSize = SvcUrl.size(); - if ((SvcUrlSize >= CandidateMatchSize) && - Url.compare(0, SvcUrlSize, SvcUrl) == 0 && + if ((SvcUrlSize >= CandidateMatchSize) && Url.compare(0, SvcUrlSize, SvcUrl) == 0 && ((SvcUrlSize == Url.size()) || (Url[SvcUrlSize] == '/'))) { CandidateMatchSize = SvcUrl.size(); - CandidateService = SvcEntry.Service; + CandidateService = SvcEntry.Service; } } diff --git a/zenhttp/httpserver.cpp b/zenhttp/httpserver.cpp index 3326f3d4a..b1bf99bce 100644 --- a/zenhttp/httpserver.cpp +++ b/zenhttp/httpserver.cpp @@ -578,8 +578,6 @@ void HttpRpcHandler::AddRpc(std::string_view RpcId, std::function<void(CbObject& RpcArgs)> HandlerFunction) { ZEN_UNUSED(RpcId, HandlerFunction); - - } ////////////////////////////////////////////////////////////////////////// @@ -705,7 +703,9 @@ HandlePackageOffers(HttpService& Service, HttpServerRequest& Request, Ref<IHttpP { PackageHandlerRef->OnRequestBegin(); - auto CreateBuffer = [&](const IoHash& Cid, uint64_t Size) -> IoBuffer { return PackageHandlerRef->CreateTarget(Cid, Size); }; + auto CreateBuffer = [&](const IoHash& Cid, uint64_t Size) -> IoBuffer { + return PackageHandlerRef->CreateTarget(Cid, Size); + }; CbPackage Package = ParsePackageMessage(Request.ReadPayload(), CreateBuffer); diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp index e9472e3b8..78cf253cc 100644 --- a/zenhttp/httpsys.cpp +++ b/zenhttp/httpsys.cpp @@ -791,7 +791,7 @@ HttpSysServer::InitializeServer(int BasePort) // port for the current user. eg: // netsh http add urlacl url=http://*:1337/ user=<some_user> - const std::u8string_view Hosts[] = { u8"[::1]"sv, u8"localhost"sv, u8"127.0.0.1"sv }; + const std::u8string_view Hosts[] = {u8"[::1]"sv, u8"localhost"sv, u8"127.0.0.1"sv}; for (const std::u8string_view Host : Hosts) { diff --git a/zenhttp/httpsys.h b/zenhttp/httpsys.h index 7df8fba8f..06bad99c3 100644 --- a/zenhttp/httpsys.h +++ b/zenhttp/httpsys.h @@ -76,8 +76,8 @@ private: WorkerThreadPool m_AsyncWorkPool; std::vector<std::wstring> m_BaseUris; // eg: http://*:nnnn/ - HTTP_SERVER_SESSION_ID m_HttpSessionId = 0; - HTTP_URL_GROUP_ID m_HttpUrlGroupId = 0; + HTTP_SERVER_SESSION_ID m_HttpSessionId = 0; + HTTP_URL_GROUP_ID m_HttpUrlGroupId = 0; HANDLE m_RequestQueueHandle = 0; std::atomic_int32_t m_PendingRequests{0}; std::atomic_int32_t m_IsShuttingDown{0}; diff --git a/zenserver/cache/cachetracking.h b/zenserver/cache/cachetracking.h index d4bd8da25..06109ebb0 100644 --- a/zenserver/cache/cachetracking.h +++ b/zenserver/cache/cachetracking.h @@ -1,10 +1,12 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + #pragma once #include <zencore/iohash.h> +#include <stdint.h> #include <filesystem> #include <functional> -#include <stdint.h> namespace zen { diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp index ae4dd4528..11ae8b41d 100644 --- a/zenserver/compute/apply.cpp +++ b/zenserver/compute/apply.cpp @@ -904,10 +904,7 @@ HttpFunctionService::ExecActionUpstream(const WorkerDesc& Worker, CbObject Actio if (!EnqueueResult.Success) { - ZEN_ERROR( - "Error enqueuing upstream Action {}/{}", - WorkerId.ToHexString(), - ActionId.ToHexString()); + ZEN_ERROR("Error enqueuing upstream Action {}/{}", WorkerId.ToHexString(), ActionId.ToHexString()); return HttpResponseCode::InternalServerError; } diff --git a/zenserver/config.cpp b/zenserver/config.cpp index 23450c370..3aef3f499 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -45,11 +45,11 @@ PickDefaultStateDirectory() return myDocumentsDir; } - int CandidateDriveLetterOffset = -1; + int CandidateDriveLetterOffset = -1; ULARGE_INTEGER CandidateDriveSize; CandidateDriveSize.QuadPart = 0L; - DWORD LogicalDrives = GetLogicalDrives(); - char CandidateDriveName[] = "A:\\"; + DWORD LogicalDrives = GetLogicalDrives(); + char CandidateDriveName[] = "A:\\"; for (int DriveLetterOffset = 0; DriveLetterOffset < 32; ++DriveLetterOffset) { if ((LogicalDrives & (1 << DriveLetterOffset)) != 0) @@ -64,7 +64,7 @@ PickDefaultStateDirectory() if ((FreeBytesAvailableToCaller.QuadPart > 0) && (TotalNumberOfBytes.QuadPart > CandidateDriveSize.QuadPart)) { CandidateDriveLetterOffset = DriveLetterOffset; - CandidateDriveSize = TotalNumberOfBytes; + CandidateDriveSize = TotalNumberOfBytes; } } } @@ -74,7 +74,7 @@ PickDefaultStateDirectory() if (CandidateDriveLetterOffset >= 0) { char RootZenFolderName[] = "A:\\zen"; - RootZenFolderName[0] = (char)('A' + CandidateDriveLetterOffset); + RootZenFolderName[0] = (char)('A' + CandidateDriveLetterOffset); return RootZenFolderName; } diff --git a/zenstore/include/zenstore/caslog.h b/zenstore/include/zenstore/caslog.h index bb9d07726..9b2ef574c 100644 --- a/zenstore/include/zenstore/caslog.h +++ b/zenstore/include/zenstore/caslog.h @@ -22,11 +22,11 @@ public: CasLogFile(); ~CasLogFile(); - void Open(std::filesystem::path FileName, size_t RecordSize, bool isCreate); - void Append(const void* DataPointer, uint64_t DataSize); - void Replay(std::function<void(const void*)>&& Handler); - void Flush(); - void Close(); + void Open(std::filesystem::path FileName, size_t RecordSize, bool isCreate); + void Append(const void* DataPointer, uint64_t DataSize); + void Replay(std::function<void(const void*)>&& Handler); + void Flush(); + void Close(); uint64_t GetLogSize(); private: diff --git a/zenutil/zenserverprocess.cpp b/zenutil/zenserverprocess.cpp index e366a917f..bc8526a20 100644 --- a/zenutil/zenserverprocess.cpp +++ b/zenutil/zenserverprocess.cpp @@ -121,7 +121,7 @@ ZenServerState::Initialize() PAGE_READWRITE, // read/write access 0, // maximum object size (high-order DWORD) m_MaxEntryCount * sizeof(ZenServerEntry), // maximum object size (low-order DWORD) - L"Local\\ZenMap"); // name of mapping object + L"Local\\ZenMap"); // name of mapping object } if (hMap == NULL) |