diff options
| author | Rutger Broekhoff | 2026-11-30 21:27:55 +0100 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-11-30 21:27:55 +0100 |
| commit | 7bba7176194c4d1d9c7066f8eda7a94491d924e6 (patch) | |
| tree | a9a171e8608786e09d6342729ee13b8471c0c9c2 /server/src/http/ext/json.cpp | |
| parent | 02475e05ccd1aa15c6a6163834f28bfebbef796f (diff) | |
| download | routemon-7bba7176194c4d1d9c7066f8eda7a94491d924e6.tar.gz routemon-7bba7176194c4d1d9c7066f8eda7a94491d924e6.zip | |
Cleanups and updates
Diffstat (limited to 'server/src/http/ext/json.cpp')
| -rw-r--r-- | server/src/http/ext/json.cpp | 34 |
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 @@ | |||
| 1 | module; | ||
| 2 | |||
| 3 | #include <boost/beast/core.hpp> | ||
| 4 | #include <boost/json/stream_parser.hpp> | ||
| 5 | |||
| 6 | module routemon:http.ext.json$impl; | ||
| 7 | |||
| 8 | import :http.ext.json; | ||
| 9 | |||
| 10 | namespace routemon::http::ext::json { | ||
| 11 | |||
| 12 | namespace { | ||
| 13 | |||
| 14 | namespace json = boost::json; | ||
| 15 | |||
| 16 | } // namespace | ||
| 17 | |||
| 18 | auto 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 | |||
| 26 | auto 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 | ||