From 1caecce8474bd55986d4233614336eb627135504 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 28 Sep 2021 21:58:40 +0200 Subject: Added preliminary CbPackageReader, for handling incremental compact binary package streaming --- zenhttp/httpshared.h | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 zenhttp/httpshared.h (limited to 'zenhttp/httpshared.h') diff --git a/zenhttp/httpshared.h b/zenhttp/httpshared.h deleted file mode 100644 index 92c1ef9c6..000000000 --- a/zenhttp/httpshared.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#pragma once - -#include -#include - -#include - -namespace zen { - -class IoBuffer; -class CbPackage; -class CompositeBuffer; - -struct CbPackageHeader -{ - uint32_t HeaderMagic; - uint32_t AttachmentCount; - uint32_t Reserved1; - uint32_t Reserved2; -}; - -static_assert(sizeof(CbPackageHeader) == 16); - -static constinit uint32_t kCbPkgMagic = 0xaa77aacc; - -struct CbAttachmentEntry -{ - uint64_t AttachmentSize; - uint32_t Flags; - IoHash AttachmentHash; - - enum - { - kIsCompressed = (1u << 0), // Is marshaled using compressed buffer storage format - kIsObject = (1u << 1), // Is compact binary object - }; -}; - -static_assert(sizeof(CbAttachmentEntry) == 32); - -std::vector FormatPackageMessage(const CbPackage& Data); -CompositeBuffer FormatPackageMessageBuffer(const CbPackage& Data); -CbPackage ParsePackageMessage( - IoBuffer Payload, - std::function CreateBuffer = [](const IoHash&, uint64_t Size) -> IoBuffer { - return IoBuffer{Size}; - }); - -} // namespace zen -- cgit v1.2.3