From 7bba7176194c4d1d9c7066f8eda7a94491d924e6 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Mon, 30 Nov 2026 21:27:55 +0100 Subject: Cleanups and updates --- server/src/http/ext/json.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 server/src/http/ext/json.cpp (limited to 'server/src/http/ext/json.cpp') diff --git a/server/src/http/ext/json.cpp b/server/src/http/ext/json.cpp new file mode 100644 index 0000000..f03d336 --- /dev/null +++ b/server/src/http/ext/json.cpp @@ -0,0 +1,34 @@ +module; + +#include +#include + +module routemon:http.ext.json$impl; + +import :http.ext.json; + +namespace routemon::http::ext::json { + +namespace { + +namespace json = boost::json; + +} // namespace + +auto body::reader::init( + boost::optional /* n */, beast::error_code& ec) noexcept + -> void +{ + p_.reset(); + ec = {}; +} + +auto body::reader::finish(beast::error_code& ec) noexcept -> void +{ + p_.finish(ec); + if (ec) + return; + *v_ = p_.release(); +} + +} // namespace routemon::http::ext::json -- cgit v1.3.1