diff options
| author | Stefan Boberg <[email protected]> | 2021-09-28 21:58:40 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-28 21:58:40 +0200 |
| commit | 1caecce8474bd55986d4233614336eb627135504 (patch) | |
| tree | de7b0bc8799295d1257a29ff5a49148e0bae321d /zenhttp/httpshared.h | |
| parent | Removed MemoryOutStream, MemoryInStream (diff) | |
| download | zen-1caecce8474bd55986d4233614336eb627135504.tar.xz zen-1caecce8474bd55986d4233614336eb627135504.zip | |
Added preliminary CbPackageReader, for handling incremental compact binary package streaming
Diffstat (limited to 'zenhttp/httpshared.h')
| -rw-r--r-- | zenhttp/httpshared.h | 51 |
1 files changed, 0 insertions, 51 deletions
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 <zencore/iobuffer.h> -#include <zencore/iohash.h> - -#include <functional> - -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<IoBuffer> FormatPackageMessage(const CbPackage& Data); -CompositeBuffer FormatPackageMessageBuffer(const CbPackage& Data); -CbPackage ParsePackageMessage( - IoBuffer Payload, - std::function<IoBuffer(const IoHash& Cid, uint64_t Size)> CreateBuffer = [](const IoHash&, uint64_t Size) -> IoBuffer { - return IoBuffer{Size}; - }); - -} // namespace zen |