From 4e2649977d034b913413d2cb35d4a88afc30393f Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 13 Sep 2021 12:24:59 +0200 Subject: Changed interface for httpServerRequest::SessionId()/RequestId() so they share storage and lazy eval logic They now call into ParseSessionId()/ParseRequestId() when required Eliminates redundant logic in derived implementations Also moved package transport code into httpshared.(cpp|h) for easier sharing with client code Added some I/O error reporting in http.sys related code Changed IHttpPackageHandler interface to support partially updated handling flow --- zenhttp/httpshared.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 zenhttp/httpshared.h (limited to 'zenhttp/httpshared.h') diff --git a/zenhttp/httpshared.h b/zenhttp/httpshared.h new file mode 100644 index 000000000..dbbebb348 --- /dev/null +++ b/zenhttp/httpshared.h @@ -0,0 +1,32 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include + +namespace zen { + +class IoBuffer; +class CbPackage; + +struct CbPackageHeader +{ + uint32_t HeaderMagic; + uint32_t AttachmentCount; + uint32_t Reserved1; + uint32_t Reserved2; +}; + +static constinit uint32_t kCbPkgMagic = 0xaa77aacc; + +struct CbAttachmentEntry +{ + uint64_t AttachmentSize; + uint32_t Reserved1; + IoHash AttachmentHash; +}; + +std::vector FormatPackageMessage(const CbPackage& Data); +CbPackage ParsePackageMessage(IoBuffer Payload); + +} // namespace zen -- cgit v1.2.3