Skip to content

burl: use zlib inflate service #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,6 @@ jobs:
with:
source-dir: boost-root/libs/${{ steps.patch.outputs.module }}
build-dir: __build_root_test__
build-target: tests
run-tests: true
generator: ${{ matrix.generator }}
generator-toolset: ${{ matrix.generator-toolset }}
Expand Down
2 changes: 1 addition & 1 deletion doc/local-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ content:

ui:
bundle:
url: https://github.com/boostorg/website-v2-docs/releases/download/ui-master/ui-bundle.zip
url: https://github.com/boostorg/website-v2-docs/releases/download/ui-develop/ui-bundle.zip
snapshot: true

antora:
Expand Down
2 changes: 1 addition & 1 deletion example/client/burl/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ project
[ ac.check-library /boost/http_proto//boost_http_proto_zlib : <library>/boost/http_proto//boost_http_proto_zlib : ]
<library>/boost/http_io//boost_http_io
<library>/boost/program_options//boost_program_options
<library>/boost/scope//scope
<library>/boost/scope//boost_scope
<library>/openssl//ssl/<link>shared
<library>/openssl//crypto/<link>shared
<target-os>windows:<library>crypt32
Expand Down
2 changes: 1 addition & 1 deletion example/client/burl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ co_main(int argc, char* argv[])
{
parser_cfg.apply_gzip_decoder = true;
parser_cfg.apply_deflate_decoder = true;
http_proto::zlib::install_service(proto_ctx);
http_proto::zlib::install_inflate_service(proto_ctx);
}
http_proto::install_parser_service(proto_ctx, parser_cfg);

Expand Down
8 changes: 4 additions & 4 deletions example/client/burl/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ string_body::string_body(std::string body, std::string content_type)
}

http_proto::method
string_body::method() const
string_body::method() const noexcept
{
return http_proto::method::post;
}
Expand Down Expand Up @@ -57,7 +57,7 @@ file_body::file_body(std::string path)
}

http_proto::method
file_body::method() const
file_body::method() const noexcept
{
return http_proto::method::put;
}
Expand Down Expand Up @@ -99,7 +99,7 @@ stdin_body::source::on_read(buffers::mutable_buffer mb)
}

http_proto::method
stdin_body::method() const
stdin_body::method() const noexcept
{
return http_proto::method::put;
}
Expand All @@ -111,7 +111,7 @@ stdin_body::content_type() const noexcept
}

boost::optional<std::size_t>
stdin_body::content_length() const
stdin_body::content_length() const noexcept
{
return boost::none;
}
Expand Down
8 changes: 4 additions & 4 deletions example/client/burl/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class string_body
string_body(std::string body, std::string content_type);

http_proto::method
method() const;
method() const noexcept;

core::string_view
content_type() const noexcept;
Expand All @@ -49,7 +49,7 @@ class file_body
file_body(std::string path);

http_proto::method
method() const;
method() const noexcept;

core::string_view
content_type() const noexcept;
Expand All @@ -72,13 +72,13 @@ class stdin_body
};

http_proto::method
method() const;
method() const noexcept;

core::string_view
content_type() const noexcept;

boost::optional<std::size_t>
content_length() const;
content_length() const noexcept;

source
body() const;
Expand Down
2 changes: 1 addition & 1 deletion example/client/burl/multipart_form.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ multipart_form::append(
}

http_proto::method
multipart_form::method() const
multipart_form::method() const noexcept
{
return http_proto::method::post;
}
Expand Down
2 changes: 1 addition & 1 deletion example/client/burl/multipart_form.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class multipart_form
std::vector<std::string> headers = {});

http_proto::method
method() const;
method() const noexcept;

std::string
content_type() const;
Expand Down
2 changes: 0 additions & 2 deletions example/client/visit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ find_package(ZLIB)

target_link_libraries(http_io_example_client_visit
boost_http_io
boost_program_options
boost_scope
OpenSSL::SSL
OpenSSL::Crypto)

Expand Down
2 changes: 0 additions & 2 deletions example/client/visit/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ project
<library>/boost/http_proto//boost_http_proto
[ ac.check-library /boost/http_proto//boost_http_proto_zlib : <library>/boost/http_proto//boost_http_proto_zlib : ]
<library>/boost/http_io//boost_http_io
<library>/boost/program_options//boost_program_options
<library>/boost/scope//scope
<library>/openssl//ssl/<link>shared
<library>/openssl//crypto/<link>shared
<target-os>windows:<library>crypt32
Expand Down
2 changes: 1 addition & 1 deletion example/client/visit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct worker
do_resolve()
{
resolver.async_resolve(
url.encoded_host(),
boost::core::string_view(url.encoded_host()),
url.scheme(),
[&](
boost::system::error_code ec,
Expand Down
12 changes: 6 additions & 6 deletions example/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ make_error_response(
if(code == http_proto::status::not_found)
{
s += "<p>The requested URL ";
s += req.target_text();
s += req.target();
s += " was not found on this server.</p>\n";
}
s += "<hr>\n";
Expand Down Expand Up @@ -241,16 +241,16 @@ handle_request(
#endif

// Request path must be absolute and not contain "..".
if( req.target_text().empty() ||
req.target_text()[0] != '/' ||
req.target_text().find("..") != core::string_view::npos)
if( req.target().empty() ||
req.target()[0] != '/' ||
req.target().find("..") != core::string_view::npos)
return make_error_response(
http_proto::status::bad_request, req, res, sr);

// Build the path to the requested file
std::string path;
path_cat(path, doc_root, req.target_text());
if(req.target_text().back() == '/')
path_cat(path, doc_root, req.target());
if(req.target().back() == '/')
path.append("index.html");

// Attempt to open the file
Expand Down
7 changes: 4 additions & 3 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#

set(EXTRAFILES
../../../url/extra/test_main.cpp
../../../url/extra/test_suite.hpp
../../../url/extra/test_suite/test_main.cpp
../../../url/extra/test_suite/test_suite.cpp
../../../url/extra/test_suite/test_suite.hpp
)

file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS *.cpp *.hpp)
Expand All @@ -22,7 +23,7 @@ find_package(OpenSSL REQUIRED)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${PFILES})
source_group("_extra" FILES ${EXTRAFILES})
add_executable(boost_http_io_tests ${PFILES} ${EXTRAFILES})
target_include_directories(boost_http_io_tests PRIVATE . ../../../url/extra)
target_include_directories(boost_http_io_tests PRIVATE . ../../../url/extra/test_suite)
target_link_libraries(boost_http_io_tests PRIVATE
OpenSSL::SSL
boost_beast
Expand Down
5 changes: 3 additions & 2 deletions test/unit/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ project
<library>/boost/beast//boost_beast/<warnings-as-errors>off
[ ac.check-library /openssl//ssl/<warnings-as-errors>off : <library>/openssl//ssl/<warnings-as-errors>off : ]
[ ac.check-library /boost/http_proto//boost_http_proto_zlib/<warnings-as-errors>off : <library>/boost/http_proto//boost_http_proto_zlib/<warnings-as-errors>off : ]
<source>../../../url/extra/test_main.cpp
<source>../../../url/extra/test_suite/test_main.cpp
<source>../../../url/extra/test_suite/test_suite.cpp
<include>.
<include>../../../url/extra
<include>../../../url/extra/test_suite
<warnings>extra
<warnings-as-errors>on
<target-os>darwin,<undefined-sanitizer>norecover:<link>static
Expand Down
Loading