From f277fad0ea747807021bb92ae8fd026384901fb7 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 13 Sep 2021 22:25:03 +0200 Subject: Implemented intended package streaming API flow (but currently it "streams" from memory) --- zenhttp/httpshared.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'zenhttp/httpshared.h') diff --git a/zenhttp/httpshared.h b/zenhttp/httpshared.h index e7c9e4a56..06fdb104f 100644 --- a/zenhttp/httpshared.h +++ b/zenhttp/httpshared.h @@ -2,8 +2,11 @@ #pragma once +#include #include +#include + namespace zen { class IoBuffer; @@ -33,6 +36,10 @@ static_assert(sizeof(CbAttachmentEntry) == 32); std::vector FormatPackageMessage(const CbPackage& Data); CompositeBuffer FormatPackageMessageBuffer(const CbPackage& Data); -CbPackage ParsePackageMessage(IoBuffer Payload); +CbPackage ParsePackageMessage( + IoBuffer Payload, + std::function CreateBuffer = [](const IoHash&, uint64_t Size) -> IoBuffer { + return IoBuffer{Size}; + }); } // namespace zen -- cgit v1.2.3