diff --git a/include/boost/burl/detail/config.hpp b/include/boost/burl/detail/config.hpp index 8212d1a..82fa64d 100644 --- a/include/boost/burl/detail/config.hpp +++ b/include/boost/burl/detail/config.hpp @@ -50,29 +50,6 @@ namespace burl #include #endif -//------------------------------------------------ - -// Add source location to error codes -#ifdef BOOST_BURL_NO_SOURCE_LOCATION -#define BOOST_BURL_ERR(ev) (::boost::system::error_code(ev)) -#define BOOST_BURL_RETURN_EC(ev) return (ev) -#else -#define BOOST_BURL_ERR(ev) \ - (::boost::system::error_code( \ - (ev), \ - [] \ - { \ - static constexpr auto loc((BOOST_CURRENT_LOCATION)); \ - return &loc; \ - }())) -#define BOOST_BURL_RETURN_EC(ev) \ - do \ - { \ - static constexpr auto loc##__LINE__((BOOST_CURRENT_LOCATION)); \ - return ::boost::system::error_code((ev), &loc##__LINE__); \ - } while(0) -#endif - } // burl } // boost diff --git a/include/boost/burl/head_parser.hpp b/include/boost/burl/head_parser.hpp index c8984ae..3e14a50 100644 --- a/include/boost/burl/head_parser.hpp +++ b/include/boost/burl/head_parser.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include @@ -259,7 +259,7 @@ class head_parser void parse( std::size_t n, - system::error_code& ec) noexcept; + std::error_code& ec) noexcept; /** Return the limits enforced by the parser. @@ -402,13 +402,13 @@ class head_parser parse_start_line_( char const*& it, char const* end, - system::error_code& ec) noexcept; + std::error_code& ec) noexcept; void parse_fields_( char const*& it, char const* end, - system::error_code& ec) noexcept; + std::error_code& ec) noexcept; }; } // namespace burl diff --git a/include/boost/burl/message_reader.hpp b/include/boost/burl/message_reader.hpp index 3fa6ef1..e5d6bca 100644 --- a/include/boost/burl/message_reader.hpp +++ b/include/boost/burl/message_reader.hpp @@ -268,7 +268,7 @@ read_header_(S& stream, parser& pr) { for(;;) { - system::error_code ec; + std::error_code ec; pr.parse_header(ec); if(!ec) co_return {}; @@ -286,7 +286,7 @@ read_body_(S& stream, parser& pr) { for(;;) { - system::error_code ec; + std::error_code ec; auto const sv = pr.flatten_body(ec); if(ec != http::error::need_data) co_return { std::error_code(ec), sv }; @@ -306,7 +306,7 @@ read_some_( { for(;;) { - system::error_code ec; + std::error_code ec; auto const n = pr.read_some(buffers, ec); if(ec != http::error::need_data) co_return { std::error_code(ec), n }; @@ -365,7 +365,7 @@ pull_( { for(;;) { - system::error_code ec; + std::error_code ec; auto const bufs = pr.pull(dest, ec); if(ec != http::error::need_data) co_return { std::error_code(ec), bufs }; diff --git a/include/boost/burl/message_writer.hpp b/include/boost/burl/message_writer.hpp index 2054aef..61fdc03 100644 --- a/include/boost/burl/message_writer.hpp +++ b/include/boost/burl/message_writer.hpp @@ -261,7 +261,7 @@ drive_( std::size_t total = 0; for(;;) { - system::error_code ec; + std::error_code ec; auto const body = bp.data(); auto const bufs = sr.frame( dest, body, more || bp.more(), ec); diff --git a/include/boost/burl/parser.hpp b/include/boost/burl/parser.hpp index ded6fda..657baa2 100644 --- a/include/boost/burl/parser.hpp +++ b/include/boost/burl/parser.hpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -346,7 +345,7 @@ class parser */ BOOST_BURL_DECL void - parse_header(system::error_code& ec); + parse_header(std::error_code& ec); /** Flatten the body in place and return it. @@ -373,7 +372,7 @@ class parser */ BOOST_BURL_DECL std::string_view - flatten_body(system::error_code& ec); + flatten_body(std::error_code& ec); /** Copy body octets into caller-supplied memory. @@ -397,7 +396,7 @@ class parser std::size_t read_some( MB const& buffers, - system::error_code& ec); + std::error_code& ec); /** Return available body octets in place. @@ -424,7 +423,7 @@ class parser std::span pull( std::span dest, - system::error_code& ec); + std::error_code& ec); /** Release body octets returned by @ref pull. @@ -464,7 +463,7 @@ class parser void parse_trailer( fields_base& f, - system::error_code& ec); + std::error_code& ec); protected: parser() = default; @@ -522,12 +521,12 @@ class parser std::size_t read_some_( capy::mutable_buffer dest, - system::error_code& ec); + std::error_code& ec); std::size_t decode_some_( capy::mutable_buffer dest, - system::error_code& ec); + std::error_code& ec); std::unique_ptr buf_; head_parser hp_; @@ -556,7 +555,7 @@ std::size_t parser:: read_some( MB const& buffers, - system::error_code& ec) + std::error_code& ec) { std::size_t n = 0; auto const end = capy::end(buffers); diff --git a/include/boost/burl/serializer.hpp b/include/boost/burl/serializer.hpp index 4ca29d1..6a0a3ca 100644 --- a/include/boost/burl/serializer.hpp +++ b/include/boost/burl/serializer.hpp @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -467,7 +466,7 @@ class serializer std::span dest, CB const& buffers, bool more, - system::error_code& ec) + std::error_code& ec) { source_of src(buffers); return frame_(dest, src, more, ec); @@ -496,7 +495,7 @@ class serializer frame( std::span dest, bool more, - system::error_code& ec) + std::error_code& ec) { source src; return frame_(dest, src, more, ec); @@ -586,7 +585,7 @@ class serializer std::span dest, source& src, bool more, - system::error_code& ec); + std::error_code& ec); bool chunked_() const noexcept; @@ -620,13 +619,13 @@ class serializer void encode_( source& src, - system::error_code& ec); + std::error_code& ec); bool ingest_( source& src, bool more, - system::error_code& ec); + std::error_code& ec); std::span gather_( diff --git a/include/boost/burl/test/response_factory.hpp b/include/boost/burl/test/response_factory.hpp index d4bf377..57d4aa0 100644 --- a/include/boost/burl/test/response_factory.hpp +++ b/include/boost/burl/test/response_factory.hpp @@ -276,7 +276,7 @@ class response_factory { if(auto [ec] = co_await message_reader{ &conn, &parser }.read_header(); ec) - throw system::system_error(ec); + throw std::system_error(ec); }()); return response{ diff --git a/src/detail/grammar.hpp b/src/detail/grammar.hpp index daddb1e..037e6d6 100644 --- a/src/detail/grammar.hpp +++ b/src/detail/grammar.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -123,7 +123,7 @@ parse_token_to_eol( char const* it, char const* end, char const*& token_end, - system::error_code& ec) noexcept + std::error_code& ec) noexcept { for(;; ++it) { @@ -175,7 +175,7 @@ parse_field( char const* end, std::string_view& name, std::string_view& value, - system::error_code& ec) + std::error_code& ec) { /* header-field = field-name ":" OWS field-value OWS @@ -253,7 +253,7 @@ parse_limited( char const* end, std::size_t limit, http::error limit_err, - system::error_code& ec) noexcept + std::error_code& ec) noexcept { bool const limited = [&]() { diff --git a/src/head_parser.cpp b/src/head_parser.cpp index c3bd477..608e572 100644 --- a/src/head_parser.cpp +++ b/src/head_parser.cpp @@ -59,7 +59,7 @@ parse_method( char const*& it, char const* end, std::string_view& result, - system::error_code& ec) + std::error_code& ec) { // parse token SP auto const first = it; @@ -92,7 +92,7 @@ parse_target( char const*& it, char const* end, std::string_view& result, - system::error_code& ec) + std::error_code& ec) { // parse target SP auto const first = it; @@ -125,7 +125,7 @@ parse_version( char const*& it, char const* end, version& result, - system::error_code& ec) + std::error_code& ec) { if(distance(it, end) < 8) { @@ -152,7 +152,7 @@ parse_status( char const*& it, char const* end, std::uint16_t& result, - system::error_code& ec) + std::error_code& ec) { // parse 3(digit) SP if(distance(it, end) < 4) @@ -193,7 +193,7 @@ parse_reason( char const*& it, char const* end, std::string_view& result, - system::error_code& ec) + std::error_code& ec) { auto const first = it; char const* token_end = nullptr; @@ -309,7 +309,7 @@ void head_parser:: parse( std::size_t n, - system::error_code& ec) noexcept + std::error_code& ec) noexcept { ec.clear(); auto const& h = h_(); @@ -369,7 +369,7 @@ head_parser:: parse_start_line_( char const*& it, char const* end, - system::error_code& ec) noexcept + std::error_code& ec) noexcept { auto& h = h_(); auto const first = it; @@ -454,7 +454,7 @@ head_parser:: parse_fields_( char const*& it, char const* end, - system::error_code& ec) noexcept + std::error_code& ec) noexcept { auto& h = h_(); std::string_view name; diff --git a/src/parser.cpp b/src/parser.cpp index 6d20ad5..8a211a6 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -577,7 +577,7 @@ flatten_chunks_() void parser:: -parse_header(system::error_code& ec) +parse_header(std::error_code& ec) { BOOST_ASSERT(started_); @@ -672,7 +672,7 @@ set_body_limit(std::uint64_t n) noexcept std::string_view parser:: -flatten_body(system::error_code& ec) +flatten_body(std::error_code& ec) { parse_header(ec); if(ec) @@ -765,7 +765,7 @@ std::size_t parser:: decode_some_( capy::mutable_buffer dest, - system::error_code& ec) + std::error_code& ec) { if(dest.size() == 0) return 0; @@ -861,7 +861,7 @@ std::size_t parser:: read_some_( capy::mutable_buffer dest, - system::error_code& ec) + std::error_code& ec) { parse_header(ec); if(ec) @@ -975,7 +975,7 @@ std::span parser:: pull( std::span dest, - system::error_code& ec) + std::error_code& ec) { parse_header(ec); if(ec) @@ -1109,7 +1109,7 @@ void parser:: parse_trailer( fields_base& f, - system::error_code& ec) + std::error_code& ec) { ec = {}; diff --git a/src/serializer.cpp b/src/serializer.cpp index d4c58c8..65b2a99 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -255,7 +255,7 @@ decide_framing_(std::uint64_t total) noexcept void serializer:: -encode_(source& src, system::error_code& ec) +encode_(source& src, std::error_code& ec) { auto feed = [&]( capy::const_buffer in, bool more) @@ -285,7 +285,7 @@ encode_(source& src, system::error_code& ec) return; auto const more = !sealed_ || src.remain != 0; stage_.consume(feed(stage_.data(), more)); - if(ec.failed() || !enc_) + if(ec || !enc_) return; } @@ -298,7 +298,7 @@ encode_(source& src, system::error_code& ec) cur, !sealed_ || src.remain != 0); cur += n; input_digested_ += n; - if(ec.failed() || !enc_) + if(ec || !enc_) return; if(cur.size() == 0) cur = src.next(); @@ -310,7 +310,7 @@ encode_(source& src, system::error_code& ec) if(enc_out_.capacity() == 0) return; feed({}, false); - if(ec.failed() || !enc_) + if(ec || !enc_) return; } } @@ -320,7 +320,7 @@ serializer:: ingest_( source& src, bool more, - system::error_code& ec) + std::error_code& ec) { auto const sealing = !more && !sealed_; @@ -495,7 +495,7 @@ frame_( std::span dest, source& src, bool more, - system::error_code& ec) + std::error_code& ec) { BOOST_ASSERT(msg_ != nullptr); diff --git a/test/unit/head_parser.cpp b/test/unit/head_parser.cpp index 1f38082..01900c0 100644 --- a/test/unit/head_parser.cpp +++ b/test/unit/head_parser.cpp @@ -75,7 +75,7 @@ class head_parser_test // place s at the parse base past the `size` // bytes already there, then parse the new total static - system::error_code + std::error_code feed( head_parser& pr, std::size_t& size, @@ -85,14 +85,14 @@ class head_parser_test BOOST_ASSERT(base + size + s.size() <= pr.ceiling()); std::memcpy(base + size, s.data(), s.size()); size += s.size(); - system::error_code ec; + std::error_code ec; pr.parse(size, ec); return ec; } // one shot into a parser with nothing in it yet static - system::error_code + std::error_code feed( head_parser& pr, std::string_view s) @@ -121,7 +121,7 @@ class head_parser_test std::memcpy(buf_, msg.data(), msg.size()); std::memcpy(buf_ + msg.size(), body.data(), body.size()); auto const fed = msg.size() + body.size(); - system::error_code ec; + std::error_code ec; pr.parse(fed, ec); BOOST_TEST(!ec); @@ -186,7 +186,7 @@ class head_parser_test "\r\n"; head_parser pr(true, buf_, sizeof(buf_)); - system::error_code ec; + std::error_code ec; std::size_t n = 0; for(char const c : msg) { @@ -417,7 +417,7 @@ class head_parser_test "\r\n"; head_parser pr(true, buf_, sizeof(buf_)); - system::error_code ec; + std::error_code ec; // bytes are appended one at a time; // those already parsed are resolved in // place and never rewritten @@ -593,7 +593,7 @@ class head_parser_test { head_parser pr(is_request, buf_, sizeof(buf_), limits); std::size_t n = 0; - system::error_code ec = feed(pr, n, msg); + std::error_code ec = feed(pr, n, msg); BOOST_TEST(ec == e); // errors are sticky pr.parse(n, ec); @@ -888,7 +888,7 @@ class head_parser_test { head_parser pr( true, buf_, sizeof(buf_), limits); - system::error_code ec; + std::error_code ec; for(std::size_t n = 0;; ++n) { pr.parse(n, ec); @@ -982,7 +982,7 @@ class head_parser_test head_parser pr(true, tiny, sizeof(tiny)); BOOST_TEST(pr.ceiling() == tiny); // default max_fields = 100 - system::error_code ec; + std::error_code ec; pr.parse(0, ec); BOOST_TEST(ec == http::error::in_place_overflow); // the error is derived again on request @@ -1055,7 +1055,7 @@ class head_parser_test // limits with it header_limits const lim{ .max_fields = 4 }; head_parser pr(true, buf, sizeof(buf), lim); - system::error_code ec; + std::error_code ec; std::size_t n = 0; std::memcpy(buf, msg.data(), 21); n = 21; @@ -1149,7 +1149,7 @@ class head_parser_test std::memmove(buf, lo.data(), lo.size()); pr.reset(buf); n = lo.size(); - system::error_code ec; + std::error_code ec; pr.parse(n, ec); BOOST_TEST(! ec); BOOST_TEST_EQ(pr.request_head().target(), "/b"); @@ -1185,7 +1185,7 @@ class head_parser_test { head_parser pr(true, raw, n, lim); BOOST_TEST(pr.ceiling() == raw); - system::error_code ec; + std::error_code ec; pr.parse(0, ec); BOOST_TEST(ec == http::error::in_place_overflow); } @@ -1212,7 +1212,7 @@ class head_parser_test // bytes or the caller has none left to give. Reports // how much was placed. static - system::error_code + std::error_code drive( head_parser& pr, std::string_view s, @@ -1220,7 +1220,7 @@ class head_parser_test std::size_t& fed) { auto* const base = base_of(pr); - system::error_code ec; + std::error_code ec; fed = 0; for(;;) { @@ -1294,7 +1294,7 @@ class head_parser_test if(off + n > sizeof(raw)) continue; - system::error_code first; + std::error_code first; for(std::size_t chunk : { 0u, 1u, 7u }) { std::memset(raw, 0xCD, sizeof(raw)); @@ -1680,7 +1680,7 @@ class head_parser_test int done = 0; for(int round = 0; round < 4; ++round) { - system::error_code ec; + std::error_code ec; for(;;) { pr.parse(held, ec); diff --git a/test/unit/parser.cpp b/test/unit/parser.cpp index cd545f8..03a9ede 100644 --- a/test/unit/parser.cpp +++ b/test/unit/parser.cpp @@ -170,7 +170,7 @@ struct test_parser : parser { for(;;) { - system::error_code ec; + std::error_code ec; parse_header(ec); if(ec != http::error::need_data) return ec; @@ -187,7 +187,7 @@ struct test_parser : parser for(;;) { - system::error_code ec; + std::error_code ec; auto const sv = flatten_body(ec); if(ec != http::error::need_data) return { ec, sv }; @@ -205,7 +205,7 @@ struct test_parser : parser for(;;) { - system::error_code ec; + std::error_code ec; auto const n = parser::read_some(buffers, ec); if(ec != http::error::need_data) return { ec, n }; @@ -252,7 +252,7 @@ struct test_parser : parser for(;;) { - system::error_code ec; + std::error_code ec; auto const bufs = parser::pull(dest, ec); if(ec != http::error::need_data) return { ec, bufs }; @@ -552,7 +552,7 @@ class parser_test pr.start(); for(int i = 0; i != 5; ++i) { - system::error_code ec; + std::error_code ec; pr.parse_header(ec); BOOST_TEST(ec == http::error::need_data); BOOST_TEST(!pr.got_header()); @@ -1217,7 +1217,7 @@ class parser_test BOOST_TEST(pr.has_buffered_data()); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 3u); @@ -1261,7 +1261,7 @@ class parser_test BOOST_TEST(body == "hello world"); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 1u); @@ -1305,7 +1305,7 @@ class parser_test BOOST_TEST(!ec); BOOST_TEST(pr.got_body()); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(tec == http::error::incomplete); BOOST_TEST_EQ(f.size(), 0u); @@ -1329,7 +1329,7 @@ class parser_test BOOST_TEST(got == "abc"); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 1u); @@ -1355,7 +1355,7 @@ class parser_test BOOST_TEST(!pr.has_buffered_data()); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST(f.empty()); @@ -1375,7 +1375,7 @@ class parser_test BOOST_TEST(body == "hello"); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST(f.empty()); @@ -1401,7 +1401,7 @@ class parser_test BOOST_TEST(!ec); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 2u); @@ -1438,7 +1438,7 @@ class parser_test BOOST_TEST(body == "hello"); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 2u); @@ -1472,7 +1472,7 @@ class parser_test BOOST_TEST(!ec); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); if(over) { @@ -1512,7 +1512,7 @@ class parser_test BOOST_TEST(pr.got_body()); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(tec == http::error::bad_field_name); BOOST_TEST_EQ(f.size(), 1u); @@ -1541,7 +1541,7 @@ class parser_test BOOST_TEST(!ec); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(tec == http::error::bad_line_ending); BOOST_TEST(f.empty()); @@ -1568,7 +1568,7 @@ class parser_test // the trailer remains available for a retry char small[8]; static_fields sf(small, sizeof(small)); - system::error_code tec; + std::error_code tec; BOOST_TEST_THROWS( pr.parse_trailer(sf, tec), std::length_error); @@ -1650,7 +1650,7 @@ class parser_test } fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 1u); @@ -3377,7 +3377,7 @@ class parser_test BOOST_TEST(pr.got_body()); fields f; - system::error_code tec; + std::error_code tec; pr.parse_trailer(f, tec); BOOST_TEST(!tec); BOOST_TEST_EQ(f.size(), 1u); diff --git a/test/unit/request_head.cpp b/test/unit/request_head.cpp index 2ee2a74..0a3806a 100644 --- a/test/unit/request_head.cpp +++ b/test/unit/request_head.cpp @@ -1060,7 +1060,7 @@ class request_head_test [&](head_parser& pr) { std::memcpy(buf, msg.data(), msg.size()); - system::error_code ec; + std::error_code ec; pr.parse(msg.size(), ec); BOOST_TEST(!ec); }; diff --git a/test/unit/request_parser.cpp b/test/unit/request_parser.cpp index 6a6d03f..12460ff 100644 --- a/test/unit/request_parser.cpp +++ b/test/unit/request_parser.cpp @@ -52,7 +52,7 @@ class request_parser_test "\r\n" "hello"); - system::error_code ec; + std::error_code ec; pr.parse_header(ec); BOOST_TEST(!ec); BOOST_TEST(pr.got_header()); diff --git a/test/unit/response_head.cpp b/test/unit/response_head.cpp index 87da62e..65171c4 100644 --- a/test/unit/response_head.cpp +++ b/test/unit/response_head.cpp @@ -474,7 +474,7 @@ class response_head_test [&](head_parser& pr) { std::memcpy(buf, msg.data(), msg.size()); - system::error_code ec; + std::error_code ec; pr.parse(msg.size(), ec); BOOST_TEST(!ec); }; @@ -523,7 +523,7 @@ class response_head_test "\r\n"; head_parser pr(false, buf, sizeof(buf)); std::memcpy(buf, msg.data(), msg.size()); - system::error_code ec; + std::error_code ec; pr.parse(msg.size(), ec); BOOST_TEST(!ec); response_head_base const& base = pr.response_head(); diff --git a/test/unit/response_parser.cpp b/test/unit/response_parser.cpp index 7d62c58..83dab01 100644 --- a/test/unit/response_parser.cpp +++ b/test/unit/response_parser.cpp @@ -51,7 +51,7 @@ class response_parser_test "\r\n" "hello"); - system::error_code ec; + std::error_code ec; pr.parse_header(ec); BOOST_TEST(!ec); BOOST_TEST(pr.got_header()); @@ -88,7 +88,7 @@ class response_parser_test "Content-Length: 5\r\n" "\r\n"); - system::error_code ec; + std::error_code ec; pr.parse_header(ec); BOOST_TEST(!ec); BOOST_TEST(pr.got_header()); diff --git a/test/unit/serializer.cpp b/test/unit/serializer.cpp index 660ad3f..0ebd8d0 100644 --- a/test/unit/serializer.cpp +++ b/test/unit/serializer.cpp @@ -151,7 +151,7 @@ class serializer_test // `wire`, consuming at most `step` octets per lap so every // cursor split point is exercised when `step` is small. // Returns when frame() has no work for this input. - static system::error_code + static std::error_code drive( serializer& sr, std::string& wire, @@ -163,7 +163,7 @@ class serializer_test { capy::const_buffer const b{ body.data(), body.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, more, ec); if(bufs.empty()) @@ -186,7 +186,7 @@ class serializer_test // Writes the whole of `body` without ending the message; // the sans-I/O equivalent of the awaitable write(). - static system::error_code + static std::error_code write( serializer& sr, std::string& wire, @@ -204,7 +204,7 @@ class serializer_test // Ends the body with `body`; the sans-I/O equivalent of the // awaitable write_eof(). - static system::error_code + static std::error_code write_eof( serializer& sr, std::string& wire, @@ -222,7 +222,7 @@ class serializer_test // Flushes outstanding output (and the header) without // supplying anything; the sans-I/O drain(). - static system::error_code + static std::error_code drain( serializer& sr, std::string& wire, @@ -234,7 +234,7 @@ class serializer_test // The same, through the frame() overload that takes no // buffer sequence at all. - static system::error_code + static std::error_code drain_bufferless( serializer& sr, std::string& wire, @@ -242,7 +242,7 @@ class serializer_test { for(;;) { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, more, ec); if(bufs.empty()) @@ -314,7 +314,7 @@ class serializer_test capy::make_buffer(b2) }; std::string wire; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const out = sr.frame(dest, bufs, false, ec); BOOST_TEST(!ec); @@ -750,7 +750,7 @@ class serializer_test std::string_view rem(body); capy::const_buffer const b{ rem.data(), rem.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto out = sr.frame(dest, b, true, ec); @@ -795,7 +795,7 @@ class serializer_test body.data(), body.size() }; auto const flatten = [&] { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -835,7 +835,7 @@ class serializer_test { capy::const_buffer const b{ rem.data(), rem.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -885,7 +885,7 @@ class serializer_test { capy::const_buffer const b{ rem.data(), rem.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -932,7 +932,7 @@ class serializer_test { capy::const_buffer const b{ body.data(), body.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -993,7 +993,7 @@ class serializer_test { capy::const_buffer const b{ rem.data(), rem.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -1033,7 +1033,7 @@ class serializer_test sr.start(&req); std::string wire; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[32]; auto const out = sr.frame(dest, bufs, false, ec); BOOST_TEST(!ec); @@ -1074,7 +1074,7 @@ class serializer_test { capy::const_buffer const b{ rem.data(), rem.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[1]; auto const bufs = sr.frame(dest, b, more, ec); more = false; @@ -1118,7 +1118,7 @@ class serializer_test { capy::const_buffer const b{ rem2.data(), rem2.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[1]; auto const bufs = sr2.frame(dest, b, false, ec); BOOST_TEST(!ec); @@ -1169,7 +1169,7 @@ class serializer_test // the wire takes the header, the prefix, and ten octets std::string wire; { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const out = sr.frame(dest, true, ec); BOOST_TEST(!ec); @@ -1230,7 +1230,7 @@ class serializer_test // for all forty octets; the wire takes the prefix and // ten of them { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; capy::const_buffer const b{ rem.data(), rem.size() }; @@ -1258,7 +1258,7 @@ class serializer_test // fewer than the chunk still owes while(!sr.is_done()) { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; capy::const_buffer const b{ rem.data(), (std::min)(std::size_t(10), rem.size()) }; @@ -1300,7 +1300,7 @@ class serializer_test sr.start(&req); std::string wire; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[32]; auto const out = sr.frame(dest, bufs, false, ec); BOOST_TEST(!ec); @@ -1348,7 +1348,7 @@ class serializer_test BOOST_TEST(sr.should_drain()); capy::const_buffer const b{ "def", 3 }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const bufs = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -1480,7 +1480,7 @@ class serializer_test std::string wire; std::string_view rem(body); { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; capy::const_buffer const b{ rem.data(), rem.size() }; @@ -1659,7 +1659,7 @@ class serializer_test std::string const b = make_body(10); { // declare eof; the wire takes nothing - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; capy::const_buffer const cb{ b.data(), b.size() }; @@ -1700,7 +1700,7 @@ class serializer_test sr.start(&res); std::string wire; - system::error_code ec; + std::error_code ec; // the wire takes half the header { @@ -1765,7 +1765,7 @@ class serializer_test std::string_view body("hello"); { - system::error_code ec; + std::error_code ec; capy::const_buffer const cb{ body.data(), body.size() }; BOOST_TEST( @@ -1800,7 +1800,7 @@ class serializer_test // the empty-dest call opens the chunk covering the // staged and the supplied octets { - system::error_code ec; + std::error_code ec; capy::const_buffer const cb{ body.data() + 2, 3 }; BOOST_TEST( @@ -1824,7 +1824,7 @@ class serializer_test sr.start(&res); { - system::error_code ec; + std::error_code ec; BOOST_TEST(sr.frame({}, false, ec).empty()); BOOST_TEST(!ec); BOOST_TEST_EQ(sr.consume(0), 0u); @@ -1870,7 +1870,7 @@ class serializer_test // chunk stands as debt std::string_view body("hello"); { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; capy::const_buffer const cb{ body.data(), body.size() }; @@ -1882,7 +1882,7 @@ class serializer_test // prefix is accepted, the surplus is not — and no error // yet { - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; std::string_view rem("helloworld"); capy::const_buffer const cb{ @@ -2562,7 +2562,7 @@ class serializer_test serializer sr(cfg); sr.start(&req, &enc); - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; capy::const_buffer const b{ body.data(), body.size() }; @@ -2839,7 +2839,7 @@ class serializer_test capy::make_buffer(b2) }; std::string wire; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const out = sr.frame(dest, bufs, false, ec); BOOST_TEST(!ec); @@ -2877,7 +2877,7 @@ class serializer_test capy::const_buffer const b{ body.data(), body.size() }; std::string wire; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const out = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -2918,7 +2918,7 @@ class serializer_test // fill the encoder's output; 64 == 0x40 capy::const_buffer const b{ body1.data(), body1.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const out = sr.frame(dest, b, true, ec); BOOST_TEST(!ec); @@ -3071,7 +3071,7 @@ class serializer_test capy::const_buffer const b{ body.data(), body.size() }; - system::error_code ec; + std::error_code ec; capy::const_buffer dest[dest_n]; auto const out = sr.frame(dest, b, true, ec); BOOST_TEST(!out.empty());