From 11a2c78d69878e40a6ebafd00fd543f1f2eab702 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 13 Sep 2021 21:43:18 +0200 Subject: Introduced FormatPackageMessageBuffer() returning a ComositeBuffer --- zenhttp/httpshared.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'zenhttp/httpshared.cpp') diff --git a/zenhttp/httpshared.cpp b/zenhttp/httpshared.cpp index f11f91fae..85687b60b 100644 --- a/zenhttp/httpshared.cpp +++ b/zenhttp/httpshared.cpp @@ -3,6 +3,7 @@ #include "httpshared.h" #include +#include #include #include #include @@ -12,6 +13,21 @@ namespace zen { +CompositeBuffer +FormatPackageMessageBuffer(const CbPackage& Data) +{ + std::vector Message = FormatPackageMessage(Data); + + std::vector Buffers; + + for (IoBuffer& Buf : Message) + { + Buffers.push_back(SharedBuffer(Buf)); + } + + return CompositeBuffer(std::move(Buffers)); +} + std::vector FormatPackageMessage(const CbPackage& Data) { -- cgit v1.2.3