summaryrefslogtreecommitdiffstats
path: root/server/src/http/ext/json.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/http/ext/json.cpp')
-rw-r--r--server/src/http/ext/json.cpp34
1 files changed, 34 insertions, 0 deletions
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 @@
1module;
2
3#include <boost/beast/core.hpp>
4#include <boost/json/stream_parser.hpp>
5
6module routemon:http.ext.json$impl;
7
8import :http.ext.json;
9
10namespace routemon::http::ext::json {
11
12namespace {
13
14namespace json = boost::json;
15
16} // namespace
17
18auto body::reader::init(
19 boost::optional<std::uint64_t> /* n */, beast::error_code& ec) noexcept
20 -> void
21{
22 p_.reset();
23 ec = {};
24}
25
26auto body::reader::finish(beast::error_code& ec) noexcept -> void
27{
28 p_.finish(ec);
29 if (ec)
30 return;
31 *v_ = p_.release();
32}
33
34} // namespace routemon::http::ext::json