diff --git a/.drone/drone.bat b/.drone/drone.bat index 580ffd1e..f3c0ef48 100755 --- a/.drone/drone.bat +++ b/.drone/drone.bat @@ -46,7 +46,7 @@ pushd !BOOST_ROOT!\libs git clone https://github.com/cppalliance/buffers -b !BOOST_BRANCH! --depth 1 popd pushd !BOOST_ROOT!\libs -git clone https://github.com/cppalliance/rts -b !BOOST_BRANCH! --depth 1 +git clone https://github.com/cppalliance/capy -b !BOOST_BRANCH! --depth 1 popd echo '==================================> COMPILE' diff --git a/.drone/drone.sh b/.drone/drone.sh index ee11fc3a..40c67ec6 100755 --- a/.drone/drone.sh +++ b/.drone/drone.sh @@ -41,9 +41,9 @@ common_install () { popd fi - if [ ! -d "$BOOST_ROOT/libs/rts" ]; then + if [ ! -d "$BOOST_ROOT/libs/capy" ]; then pushd $BOOST_ROOT/libs - git clone https://github.com/cppalliance/rts -b $BOOST_BRANCH --depth 1 + git clone https://github.com/cppalliance/capy -b $BOOST_BRANCH --depth 1 popd fi } @@ -126,9 +126,9 @@ if [ ! -d "$BOOST_ROOT/libs/buffers" ]; then git clone https://github.com/cppalliance/buffers -b $BOOST_BRANCH --depth 1 popd fi -if [ ! -d "$BOOST_ROOT/libs/rts" ]; then +if [ ! -d "$BOOST_ROOT/libs/capy" ]; then pushd $BOOST_ROOT/libs - git clone https://github.com/cppalliance/rts -b $BOOST_BRANCH --depth 1 + git clone https://github.com/cppalliance/capy -b $BOOST_BRANCH --depth 1 popd fi cd libs/$SELF diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8932e429..254c3b01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -870,11 +870,11 @@ jobs: repository: cppalliance/buffers ref: develop - - name: Clone Boost.RunTimeServices + - name: Clone Boost.Capy uses: actions/checkout@v3 with: - path: rts-root - repository: cppalliance/rts + path: capy-root + repository: cppalliance/capy ref: develop - name: Setup C++ @@ -906,11 +906,11 @@ jobs: scan-modules-dir: | http-proto-root buffers-root - rts-root + capy-root scan-modules-ignore: | http_proto buffers - rts + capy - name: Install Packages (Windows) uses: alandefreitas/cpp-actions/package-install@v1.9.0 @@ -932,8 +932,8 @@ jobs: triplet=${{ matrix.x86 && 'x86-windows-static' || 'x64-windows' }} addrmdl=${{ matrix.x86 && '32' || '64' }} - # This is temporary until we move rts/build/brotli.jam to boost/tools/build - echo "import-search ${home}/boost-root/libs/rts/build ;" | sed 's/\/d\//D:\//g' >> user-config.jam + # This is temporary until we move capy/build/brotli.jam to boost/tools/build + echo "import-search ${home}/boost-root/libs/capy/build ;" | sed 's/\/d\//D:\//g' >> user-config.jam echo "using zlib : : \"${home}/vcpkg-root/installed/${triplet}/include\" \"${home}/vcpkg-root/installed/${triplet}/lib\" \"${home}/vcpkg-root/installed/${triplet}/bin\" zlib : ${addrmdl} ;" | sed 's/\/d\//D:\//g' >> user-config.jam echo "using brotli : : \"${home}/vcpkg-root/installed/${triplet}/include\" \"${home}/vcpkg-root/installed/${triplet}/lib\" \"${home}/vcpkg-root/installed/${triplet}/bin\" : ${addrmdl} ;" | sed 's/\/d\//D:\//g' >> user-config.jam @@ -980,7 +980,7 @@ jobs: # Patch boost-root with workspace module cp -r "$workspace_root"/http-proto-root "libs/$module" cp -r "$workspace_root"/buffers-root libs/buffers - cp -r "$workspace_root"/rts-root libs/rts + cp -r "$workspace_root"/capy-root libs/capy - name: Boost B2 Workflow uses: alandefreitas/cpp-actions/b2-workflow@v1.9.0 @@ -1203,11 +1203,11 @@ jobs: repository: cppalliance/buffers ref: develop - - name: Clone Boost.RunTimeServices + - name: Clone Boost.Capy uses: actions/checkout@v3 with: - path: rts-root - repository: cppalliance/rts + path: capy-root + repository: cppalliance/capy ref: develop - name: Clone Boost @@ -1220,11 +1220,11 @@ jobs: scan-modules-dir: | http-proto-root buffers-root - rts-root + capy-root scan-modules-ignore: | http_proto buffers - rts + capy - name: Patch Boost id: patch @@ -1258,7 +1258,7 @@ jobs: # Patch boost-root with workspace module cp -r "$workspace_root"/http-proto-root "libs/$module" cp -r "$workspace_root"/buffers-root libs/buffers - cp -r "$workspace_root"/rts-root libs/rts + cp -r "$workspace_root"/capy-root libs/capy - uses: actions/setup-node@v4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index fa2d4791..ff212d84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,9 +56,9 @@ set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use set(BOOST_HTTP_PROTO_DEPENDENCIES Boost::assert Boost::buffers + Boost::capy Boost::config Boost::core - Boost::rts Boost::static_assert Boost::system Boost::throw_exception diff --git a/build/Jamfile b/build/Jamfile index d4a113ff..b4898e96 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -40,13 +40,13 @@ lib boost_http_proto : http_proto_sources : requirements /boost//buffers - /boost//rts + /boost//capy /boost//url ../ BOOST_HTTP_PROTO_SOURCE : usage-requirements /boost//buffers - /boost//rts + /boost//capy /boost//url ; diff --git a/include/boost/http_proto/parser.hpp b/include/boost/http_proto/parser.hpp index 029b441f..6af8c8dd 100644 --- a/include/boost/http_proto/parser.hpp +++ b/include/boost/http_proto/parser.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -617,7 +617,7 @@ class parser BOOST_HTTP_PROTO_DECL ~parser(); BOOST_HTTP_PROTO_DECL parser() noexcept; BOOST_HTTP_PROTO_DECL parser(parser&& other) noexcept; - BOOST_HTTP_PROTO_DECL parser(rts::polystore&, detail::kind); + BOOST_HTTP_PROTO_DECL parser(capy::polystore&, detail::kind); BOOST_HTTP_PROTO_DECL void assign(parser&& other) noexcept; BOOST_HTTP_PROTO_DECL @@ -668,7 +668,7 @@ struct parser::config_base /** Enable Brotli Content-Encoding decoding. - Requires `boost::rts::brotli::decode_service` to be + Requires `boost::capy::brotli::decode_service` to be installed, otherwise an exception is thrown. */ bool apply_brotli_decoder = false; @@ -693,7 +693,7 @@ struct parser::config_base Larger windows improve decompression at the cost of memory. If a larger window is required than allowed, decoding fails with - `rts::zlib::error::data_err`. + `capy::zlib::error::data_err`. */ int zlib_window_bits = 15; @@ -769,7 +769,7 @@ struct parser::config_base BOOST_HTTP_PROTO_DECL void install_parser_service( - rts::polystore& ctx, + capy::polystore& ctx, parser::config_base const& cfg); } // http_proto diff --git a/include/boost/http_proto/request_parser.hpp b/include/boost/http_proto/request_parser.hpp index bcdd06c2..9c4ef457 100644 --- a/include/boost/http_proto/request_parser.hpp +++ b/include/boost/http_proto/request_parser.hpp @@ -140,7 +140,7 @@ class request_parser */ BOOST_HTTP_PROTO_DECL explicit - request_parser(rts::polystore& ctx); + request_parser(capy::polystore& ctx); /** Return a reference to the parsed request headers. diff --git a/include/boost/http_proto/response_parser.hpp b/include/boost/http_proto/response_parser.hpp index 3b1d6e14..97f935c5 100644 --- a/include/boost/http_proto/response_parser.hpp +++ b/include/boost/http_proto/response_parser.hpp @@ -140,7 +140,7 @@ class response_parser */ BOOST_HTTP_PROTO_DECL explicit - response_parser(rts::polystore& ctx); + response_parser(capy::polystore& ctx); /** Prepare for the next message on the stream. diff --git a/include/boost/http_proto/serializer.hpp b/include/boost/http_proto/serializer.hpp index 282a60e1..e0e65d08 100644 --- a/include/boost/http_proto/serializer.hpp +++ b/include/boost/http_proto/serializer.hpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -171,7 +171,7 @@ class serializer BOOST_HTTP_PROTO_DECL explicit serializer( - rts::polystore& ctx); + capy::polystore& ctx); /** Reset the serializer for a new message. @@ -574,7 +574,7 @@ struct serializer::config { /** Enable Brotli Content-Encoding. - Requires `boost::rts::brotli::encode_service` to be + Requires `boost::capy::brotli::encode_service` to be installed, otherwise an exception is thrown. */ bool apply_brotli_encoder = false; @@ -668,7 +668,7 @@ struct serializer::config BOOST_HTTP_PROTO_DECL void install_serializer_service( - rts::polystore& ctx, + capy::polystore& ctx, serializer::config const& cfg); //------------------------------------------------ diff --git a/src/detail/zlib_filter_base.hpp b/src/detail/zlib_filter_base.hpp index 71564872..e57380a8 100644 --- a/src/detail/zlib_filter_base.hpp +++ b/src/detail/zlib_filter_base.hpp @@ -15,8 +15,8 @@ #include "src/detail/filter.hpp" -#include -#include +#include +#include namespace boost { namespace http_proto { @@ -35,7 +35,7 @@ class zlib_filter_base : public filter } protected: - rts::zlib::stream strm_; + capy::zlib::stream strm_; static unsigned int diff --git a/src/parser.cpp b/src/parser.cpp index fad95e6b..1e98c8c2 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -20,10 +20,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -305,19 +305,19 @@ clamp( class zlib_filter : public detail::zlib_filter_base { - rts::zlib::inflate_service& svc_; + capy::zlib::inflate_service& svc_; public: zlib_filter( - const rts::polystore& ctx, + const capy::polystore& ctx, http_proto::detail::workspace& ws, int window_bits) : zlib_filter_base(ws) - , svc_(ctx.get()) + , svc_(ctx.get()) { - system::error_code ec = static_cast( + system::error_code ec = static_cast( svc_.init2(strm_, window_bits)); - if(ec != rts::zlib::error::ok) + if(ec != capy::zlib::error::ok) detail::throw_system_error(ec); } @@ -334,17 +334,17 @@ class zlib_filter strm_.next_in = static_cast(const_cast(in.data())); strm_.avail_in = saturate_cast(in.size()); - auto rs = static_cast( + auto rs = static_cast( svc_.inflate( strm_, - more ? rts::zlib::no_flush : rts::zlib::finish)); + more ? capy::zlib::no_flush : capy::zlib::finish)); results rv; rv.out_bytes = saturate_cast(out.size()) - strm_.avail_out; rv.in_bytes = saturate_cast(in.size()) - strm_.avail_in; - rv.finished = (rs == rts::zlib::error::stream_end); + rv.finished = (rs == capy::zlib::error::stream_end); - if(rs < rts::zlib::error::ok && rs != rts::zlib::error::buf_err) + if(rs < capy::zlib::error::ok && rs != capy::zlib::error::buf_err) rv.ec = rs; return rv; @@ -354,14 +354,14 @@ class zlib_filter class brotli_filter : public detail::brotli_filter_base { - rts::brotli::decode_service& svc_; - rts::brotli::decoder_state* state_; + capy::brotli::decode_service& svc_; + capy::brotli::decoder_state* state_; public: brotli_filter( - const rts::polystore& ctx, + const capy::polystore& ctx, http_proto::detail::workspace&) - : svc_(ctx.get()) + : svc_(ctx.get()) { // TODO: use custom allocator state_ = svc_.create_instance(nullptr, nullptr, nullptr); @@ -401,10 +401,10 @@ class brotli_filter rv.out_bytes = out.size() - available_out; rv.finished = svc_.is_finished(state_); - if(!more && rs == rts::brotli::decoder_result::needs_more_input) + if(!more && rs == capy::brotli::decoder_result::needs_more_input) rv.ec = BOOST_HTTP_PROTO_ERR(error::bad_payload); - if(rs == rts::brotli::decoder_result::error) + if(rs == capy::brotli::decoder_result::error) rv.ec = BOOST_HTTP_PROTO_ERR( svc_.get_error_code(state_)); @@ -505,7 +505,7 @@ class parser_service void install_parser_service( - rts::polystore& ctx, + capy::polystore& ctx, parser::config_base const& cfg) { ctx.emplace(cfg); @@ -534,7 +534,7 @@ class parser::impl elastic, }; - const rts::polystore& ctx_; + const capy::polystore& ctx_; parser_service& svc_; detail::workspace ws_; @@ -567,7 +567,7 @@ class parser::impl bool chunked_body_ended; public: - impl(const rts::polystore& ctx, detail::kind k) + impl(const capy::polystore& ctx, detail::kind k) : ctx_(ctx) , svc_(ctx.get()) , ws_(svc_.space_needed) @@ -1866,7 +1866,7 @@ parser(parser&& other) noexcept parser:: parser( - rts::polystore& ctx, + capy::polystore& ctx, detail::kind k) : impl_(new impl(ctx, k)) { diff --git a/src/request_parser.cpp b/src/request_parser.cpp index 4778a428..64c65edb 100644 --- a/src/request_parser.cpp +++ b/src/request_parser.cpp @@ -14,7 +14,7 @@ namespace http_proto { request_parser:: request_parser( - rts::polystore& ctx) + capy::polystore& ctx) : parser( ctx, detail::kind::request) diff --git a/src/response_parser.cpp b/src/response_parser.cpp index 443003eb..277ba43e 100644 --- a/src/response_parser.cpp +++ b/src/response_parser.cpp @@ -14,7 +14,7 @@ namespace http_proto { response_parser:: response_parser( - rts::polystore& ctx) + capy::polystore& ctx) : parser( ctx, detail::kind::response) diff --git a/src/serializer.cpp b/src/serializer.cpp index 07035451..0e1450e9 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -23,13 +23,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -90,26 +90,26 @@ write_chunk_header( class zlib_filter : public detail::zlib_filter_base { - rts::zlib::deflate_service& svc_; + capy::zlib::deflate_service& svc_; public: zlib_filter( - const rts::polystore& ctx, + const capy::polystore& ctx, http_proto::detail::workspace& ws, int comp_level, int window_bits, int mem_level) : zlib_filter_base(ws) - , svc_(ctx.get()) + , svc_(ctx.get()) { - system::error_code ec = static_cast(svc_.init2( + system::error_code ec = static_cast(svc_.init2( strm_, comp_level, - rts::zlib::deflated, + capy::zlib::deflated, window_bits, mem_level, - rts::zlib::default_strategy)); - if(ec != rts::zlib::error::ok) + capy::zlib::default_strategy)); + if(ec != capy::zlib::error::ok) detail::throw_system_error(ec); } @@ -135,17 +135,17 @@ class zlib_filter strm_.next_in = static_cast(const_cast(in.data())); strm_.avail_in = saturate_cast(in.size()); - auto rs = static_cast( + auto rs = static_cast( svc_.deflate( strm_, - more ? rts::zlib::no_flush : rts::zlib::finish)); + more ? capy::zlib::no_flush : capy::zlib::finish)); results rv; rv.out_bytes = saturate_cast(out.size()) - strm_.avail_out; rv.in_bytes = saturate_cast(in.size()) - strm_.avail_in; - rv.finished = (rs == rts::zlib::error::stream_end); + rv.finished = (rs == capy::zlib::error::stream_end); - if(rs < rts::zlib::error::ok && rs != rts::zlib::error::buf_err) + if(rs < capy::zlib::error::ok && rs != capy::zlib::error::buf_err) rv.ec = rs; return rv; @@ -155,22 +155,22 @@ class zlib_filter class brotli_filter : public detail::brotli_filter_base { - rts::brotli::encode_service& svc_; - rts::brotli::encoder_state* state_; + capy::brotli::encode_service& svc_; + capy::brotli::encoder_state* state_; public: brotli_filter( - const rts::polystore& ctx, + const capy::polystore& ctx, http_proto::detail::workspace&, std::uint32_t comp_quality, std::uint32_t comp_window) - : svc_(ctx.get()) + : svc_(ctx.get()) { // TODO: use custom allocator state_ = svc_.create_instance(nullptr, nullptr, nullptr); if(!state_) detail::throw_bad_alloc(); - using encoder_parameter = rts::brotli::encoder_parameter; + using encoder_parameter = capy::brotli::encoder_parameter; svc_.set_parameter(state_, encoder_parameter::quality, comp_quality); svc_.set_parameter(state_, encoder_parameter::lgwin, comp_window); } @@ -194,7 +194,7 @@ class brotli_filter auto available_out = out.size(); using encoder_operation = - rts::brotli::encoder_operation; + capy::brotli::encoder_operation; bool rs = svc_.compress_stream( state_, @@ -267,7 +267,7 @@ class serializer_service void install_serializer_service( - rts::polystore& ctx, + capy::polystore& ctx, serializer::config const& cfg) { ctx.emplace(cfg); @@ -295,7 +295,7 @@ class serializer::impl stream }; - const rts::polystore& ctx_; + const capy::polystore& ctx_; serializer_service& svc_; detail::workspace ws_; @@ -317,7 +317,7 @@ class serializer::impl bool filter_done_ = false; public: - impl(const rts::polystore& ctx) + impl(const capy::polystore& ctx) : ctx_(ctx) , svc_(ctx_.get()) , ws_(svc_.space_needed) @@ -955,7 +955,7 @@ operator=(serializer&& other) noexcept } serializer:: -serializer(rts::polystore& ctx) +serializer(capy::polystore& ctx) : impl_(new impl(ctx)) { // TODO: use a single allocation for diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt index a7ded6af..62d188c2 100644 --- a/test/cmake_test/CMakeLists.txt +++ b/test/cmake_test/CMakeLists.txt @@ -25,9 +25,9 @@ else() assert buffers + capy config core - rts static_assert system throw_exception diff --git a/test/limits/CMakeLists.txt b/test/limits/CMakeLists.txt index 44172085..db67f8a4 100644 --- a/test/limits/CMakeLists.txt +++ b/test/limits/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(boost_http_proto_limits PRIVATE Boost::buffers Boost::config Boost::container_hash - Boost::rts + Boost::capy Boost::system Boost::throw_exception Boost::url diff --git a/test/limits/Jamfile b/test/limits/Jamfile index 1c59cc10..d690406d 100644 --- a/test/limits/Jamfile +++ b/test/limits/Jamfile @@ -19,7 +19,7 @@ project ../.. ../../../url/extra/test_suite /boost//buffers - /boost//rts + /boost//capy /boost//url ; diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index caca6606..bf0cba20 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -24,12 +24,12 @@ target_link_libraries( Boost::http_proto Boost::filesystem) -if (TARGET Boost::rts_zlib) - target_link_libraries(boost_http_proto_tests PRIVATE Boost::rts_zlib) +if (TARGET Boost::capy_zlib) + target_link_libraries(boost_http_proto_tests PRIVATE Boost::capy_zlib) endif () -if (TARGET Boost::rts_brotli) - target_link_libraries(boost_http_proto_tests PRIVATE Boost::rts_brotli) +if (TARGET Boost::capy_brotli) + target_link_libraries(boost_http_proto_tests PRIVATE Boost::capy_brotli) endif () # Register individual tests with CTest diff --git a/test/unit/Jamfile b/test/unit/Jamfile index 76586177..f4a4e730 100644 --- a/test/unit/Jamfile +++ b/test/unit/Jamfile @@ -17,8 +17,8 @@ project $(c11-requires) /boost/http_proto//boost_http_proto /boost/url//boost_url - [ ac.check-library /boost/rts//boost_rts_zlib : /boost/rts//boost_rts_zlib : ] - [ ac.check-library /boost/rts//boost_rts_brotli : /boost/rts//boost_rts_brotli : ] + [ ac.check-library /boost/capy//boost_capy_zlib : /boost/capy//boost_capy_zlib : ] + [ ac.check-library /boost/capy//boost_capy_brotli : /boost/capy//boost_capy_brotli : ] ../../../url/extra/test_suite/test_main.cpp ../../../url/extra/test_suite/test_suite.cpp ./test_helpers.cpp diff --git a/test/unit/compression.cpp b/test/unit/compression.cpp index 241f0064..da37690c 100644 --- a/test/unit/compression.cpp +++ b/test/unit/compression.cpp @@ -15,9 +15,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "test_helpers.hpp" @@ -55,7 +55,7 @@ struct zlib_test static std::string compress( - const rts::polystore& ctx, + const capy::polystore& ctx, core::string_view encoding, core::string_view body) { @@ -64,7 +64,7 @@ struct zlib_test if(encoding == "deflate" || encoding == "gzip") { - namespace zlib = rts::zlib; + namespace zlib = capy::zlib; auto& svc = ctx.get(); zlib::stream zs{}; @@ -100,7 +100,7 @@ struct zlib_test } else if(encoding == "br") { - namespace brotli = rts::brotli; + namespace brotli = capy::brotli; auto& svc = ctx.get(); brotli::encoder_state* state = @@ -145,14 +145,14 @@ struct zlib_test static void verify_compressed( - const rts::polystore& ctx, + const capy::polystore& ctx, core::string_view encoding, core::string_view compressed_body, core::string_view body) { if(encoding == "deflate" || encoding == "gzip") { - namespace zlib = rts::zlib; + namespace zlib = capy::zlib; auto& svc = ctx.get(); zlib::stream zs{}; @@ -191,7 +191,7 @@ struct zlib_test } else if(encoding == "br") { - namespace brotli = rts::brotli; + namespace brotli = capy::brotli; auto& svc = ctx.get(); brotli::decoder_state* state = @@ -376,22 +376,22 @@ struct zlib_test void test_serializer() { - rts::polystore ctx; + capy::polystore ctx; std::vector encodings; serializer::config cfg; - #ifdef BOOST_RTS_HAS_ZLIB + #ifdef BOOST_CAPY_HAS_ZLIB cfg.apply_deflate_encoder = true; cfg.apply_gzip_encoder = true; - rts::zlib::install_deflate_service(ctx); - rts::zlib::install_inflate_service(ctx); + capy::zlib::install_deflate_service(ctx); + capy::zlib::install_inflate_service(ctx); encodings.push_back("gzip"); encodings.push_back("deflate"); #endif - #ifdef BOOST_RTS_HAS_BROTLI + #ifdef BOOST_CAPY_HAS_BROTLI cfg.apply_brotli_encoder = true; - rts::brotli::install_encode_service(ctx); - rts::brotli::install_decode_service(ctx); + capy::brotli::install_encode_service(ctx); + capy::brotli::install_decode_service(ctx); encodings.push_back("br"); #endif @@ -612,22 +612,22 @@ struct zlib_test void test_parser() { - rts::polystore ctx; + capy::polystore ctx; std::vector encodings; response_parser::config cfg; - #ifdef BOOST_RTS_HAS_ZLIB + #ifdef BOOST_CAPY_HAS_ZLIB cfg.apply_deflate_decoder = true; cfg.apply_gzip_decoder = true; - rts::zlib::install_deflate_service(ctx); - rts::zlib::install_inflate_service(ctx); + capy::zlib::install_deflate_service(ctx); + capy::zlib::install_inflate_service(ctx); encodings.push_back("gzip"); encodings.push_back("deflate"); #endif - #ifdef BOOST_RTS_HAS_BROTLI + #ifdef BOOST_CAPY_HAS_BROTLI cfg.apply_brotli_decoder = true; - rts::brotli::install_encode_service(ctx); - rts::brotli::install_decode_service(ctx); + capy::brotli::install_encode_service(ctx); + capy::brotli::install_decode_service(ctx); encodings.push_back("br"); #endif diff --git a/test/unit/parser.cpp b/test/unit/parser.cpp index cc796eaa..340a52bf 100644 --- a/test/unit/parser.cpp +++ b/test/unit/parser.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "test_helpers.hpp" @@ -194,13 +194,13 @@ struct parser_test using pieces = std::vector< core::string_view>; - rts::polystore ctx_; + capy::polystore ctx_; core::string_view sh_; core::string_view sb_; request_parser req_pr_; response_parser res_pr_; parser* pr_ = nullptr; - opt ctx_opt_; + opt ctx_opt_; opt req_pr_opt_; opt res_pr_opt_; pieces in_; @@ -208,7 +208,7 @@ struct parser_test parser_test() : ctx_() , req_pr_( - [&]() -> rts::polystore& + [&]() -> capy::polystore& { request_parser::config cfg; cfg.body_limit = 5; @@ -337,7 +337,7 @@ struct parser_test { // parser(parser&&) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, {}); core::string_view header = @@ -379,7 +379,7 @@ struct parser_test void testStart() { - rts::polystore ctx; + capy::polystore ctx; request_parser::config_base cfg; install_parser_service(ctx, cfg); @@ -460,7 +460,7 @@ struct parser_test request_parser::config const& cfg, std::size_t n) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, cfg); request_parser pr(ctx); @@ -503,7 +503,7 @@ struct parser_test std::size_t n, core::string_view s) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, cfg); system::error_code ec; request_parser pr(ctx); @@ -556,7 +556,7 @@ struct parser_test core::string_view s, system::error_code ex = error::need_data) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, cfg); system::error_code ec; request_parser req_pr(ctx); @@ -673,7 +673,7 @@ struct parser_test { // fill capacity first - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); system::error_code ec; @@ -718,7 +718,7 @@ struct parser_test request_parser::config cfg; pieces in({ "GET / HTTP/1.1\r\n\r\n"}); - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, cfg); system::error_code ec; request_parser pr(ctx); @@ -830,7 +830,7 @@ struct parser_test // VFALCO missing chunked implementation { // buffered payload - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); request_parser pr(ctx_); @@ -852,7 +852,7 @@ struct parser_test bool is_complete, pieces&& in) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, cfg); system::error_code ec; response_parser pr(ctx); @@ -917,7 +917,7 @@ struct parser_test { // no-op - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; install_parser_service(ctx, cfg); system::error_code ec; @@ -943,7 +943,7 @@ struct parser_test { // commit too large - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; install_parser_service(ctx, cfg); system::error_code ec; @@ -1142,7 +1142,7 @@ struct parser_test bool is_complete, pieces&& in) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, cfg); system::error_code ec; response_parser pr(ctx); @@ -1625,7 +1625,7 @@ struct parser_test void testChunkedInPlace() { - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; install_parser_service(ctx, cfg); @@ -1861,7 +1861,7 @@ struct parser_test testMultipleMessageInPlace() { request_parser::config cfg; - rts::polystore ctx; + capy::polystore ctx; cfg.headers.max_size = 500; cfg.min_buffer = 500; @@ -1972,7 +1972,7 @@ struct parser_test }; request_parser::config cfg; - rts::polystore ctx; + capy::polystore ctx; cfg.min_buffer = 500; cfg.headers.max_size = 500; @@ -2052,7 +2052,7 @@ struct parser_test void testSetBodyLimit() { - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; cfg.body_limit = 7; install_parser_service(ctx, cfg); @@ -2140,7 +2140,7 @@ struct parser_test // the parsed header must remain valid and // accessible if an error occurs during body parsing. - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; install_parser_service(ctx, cfg); response_parser pr(ctx); diff --git a/test/unit/request_parser.cpp b/test/unit/request_parser.cpp index a6373042..c48f898f 100644 --- a/test/unit/request_parser.cpp +++ b/test/unit/request_parser.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include "test_suite.hpp" @@ -86,7 +86,7 @@ struct request_parser_test void good( - rts::polystore& ctx, + capy::polystore& ctx, core::string_view s, core::string_view expected = {}) { @@ -107,7 +107,7 @@ struct request_parser_test } void - bad(rts::polystore& ctx, core::string_view s) + bad(capy::polystore& ctx, core::string_view s) { for(std::size_t nmax = 1; nmax < s.size(); ++nmax) @@ -135,7 +135,7 @@ struct request_parser_test BOOST_TEST(req.version() == v); }; - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); @@ -213,16 +213,16 @@ struct request_parser_test { request_parser pr; - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); BOOST_TEST_NO_THROW(pr = request_parser(ctx)); } - // request_parser(rts::polystore&) + // request_parser(capy::polystore&) { - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); request_parser pr(ctx); @@ -230,7 +230,7 @@ struct request_parser_test // request_parser(request_parser&&) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, {}); request_parser pr1(ctx); request_parser pr2(std::move(pr1)); @@ -266,7 +266,7 @@ struct request_parser_test "\r\n\r\n"; }; - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); @@ -325,7 +325,7 @@ struct request_parser_test void testGet() { - rts::polystore ctx; + capy::polystore ctx; request_parser::config cfg; install_parser_service(ctx, cfg); request_parser pr(ctx); diff --git a/test/unit/response_parser.cpp b/test/unit/response_parser.cpp index 31b86582..164413ea 100644 --- a/test/unit/response_parser.cpp +++ b/test/unit/response_parser.cpp @@ -10,7 +10,7 @@ // Test that header file is self-contained. #include -#include +#include #include "test_suite.hpp" @@ -32,7 +32,7 @@ class response_parser_test { response_parser pr; - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; install_parser_service(ctx, cfg); @@ -43,9 +43,9 @@ class response_parser_test BOOST_TEST_NO_THROW(pr = response_parser()); } - // response_parser(rts::polystore&) + // response_parser(capy::polystore&) { - rts::polystore ctx; + capy::polystore ctx; response_parser::config cfg; install_parser_service(ctx, cfg); response_parser pr(ctx); @@ -53,7 +53,7 @@ class response_parser_test // response_parser(response_parser&&) { - rts::polystore ctx; + capy::polystore ctx; install_parser_service(ctx, {}); response_parser pr1(ctx); response_parser pr2(std::move(pr1)); diff --git a/test/unit/serializer.cpp b/test/unit/serializer.cpp index 79c166b4..1cde8462 100644 --- a/test/unit/serializer.cpp +++ b/test/unit/serializer.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "test_helpers.hpp" @@ -180,7 +180,7 @@ struct serializer_test void testSyntax() { - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); response res; @@ -213,7 +213,7 @@ struct serializer_test void testSpecial() { - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); response res; res.set_chunked(true); @@ -281,7 +281,7 @@ struct serializer_test core::string_view expected) { response res(headers); - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); sr.start(res); @@ -338,7 +338,7 @@ struct serializer_test body.remove_prefix(buf_size); } - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); sr.start(res, buf); @@ -364,7 +364,7 @@ struct serializer_test response res(headers); // we limit the buffer size of the serializer, requiring // it to make multiple calls to source::read - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); sr.start(res, std::forward< @@ -381,7 +381,7 @@ struct serializer_test F f) { response res(headers); - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); auto stream = sr.start_stream(res); @@ -569,7 +569,7 @@ struct serializer_test response res( "HTTP/1.1 200 OK\r\n" "\r\n"); - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); @@ -723,7 +723,7 @@ struct serializer_test { // request { - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); request req( @@ -769,7 +769,7 @@ struct serializer_test // empty body { - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); request req( @@ -814,7 +814,7 @@ struct serializer_test "Expect: 100-continue\r\n" "\r\n"; - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); response res(sv); @@ -844,7 +844,7 @@ struct serializer_test "HTTP/1.1 200 OK\r\n" "\r\n"; response res(sv); - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); auto stream = sr.start_stream(res); @@ -896,7 +896,7 @@ struct serializer_test "Transfer-Encoding: chunked\r\n" "\r\n"; response res(sv); - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); auto stream = sr.start_stream(res); @@ -957,7 +957,7 @@ struct serializer_test void testOverConsume() { - rts::polystore ctx; + capy::polystore ctx; install_serializer_service(ctx, {}); serializer sr(ctx); request req;