Update boost requirement to 1.81.0 and fix some API changes in rpc_connection.cpp

This commit is contained in:
clemahieu 2023-01-13 11:38:07 +00:00
commit 9bb3cbecca
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
2 changed files with 5 additions and 5 deletions

View file

@ -387,7 +387,7 @@ set(Boost_USE_MULTITHREADED ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
find_package(Boost 1.70.0 REQUIRED COMPONENTS filesystem log log_setup thread
find_package(Boost 1.81.0 REQUIRED COMPONENTS filesystem log log_setup thread
program_options system)
# diskhash
@ -585,7 +585,7 @@ if(NANO_FUZZER_TEST)
endif()
if(NANO_TEST OR RAIBLOCKS_TEST)
find_package(Boost 1.70.0 REQUIRED COMPONENTS coroutine context)
find_package(Boost 1.81.0 REQUIRED COMPONENTS coroutine context)
if(WIN32)
if(MSVC_VERSION)
if(MSVC_VERSION GREATER_EQUAL 1910)

View file

@ -105,7 +105,7 @@ void nano::rpc_connection::parse_request (STREAM_TYPE & stream, std::shared_ptr<
auto header_field_credentials_l (header_parser->get ()["nano-api-key"]);
auto header_corr_id_l (header_parser->get ()["nano-correlation-id"]);
auto body_parser (std::make_shared<boost::beast::http::request_parser<boost::beast::http::string_body>> (std::move (*header_parser)));
auto path_l (body_parser->get ().target ().to_string ());
std::string path_l = body_parser->get ().target ();
boost::beast::http::async_read (stream, buffer, *body_parser, boost::asio::bind_executor (strand, [this_l, body_parser, header_field_credentials_l, header_corr_id_l, path_l, &stream] (boost::system::error_code const & ec, size_t bytes_transferred) {
if (!ec)
{
@ -142,8 +142,8 @@ void nano::rpc_connection::parse_request (STREAM_TYPE & stream, std::shared_ptr<
auto handler (std::make_shared<nano::rpc_handler> (this_l->rpc_config, req.body (), request_id, response_handler, this_l->rpc_handler_interface, this_l->logger));
nano::rpc_handler_request_params request_params;
request_params.rpc_version = rpc_version_l;
request_params.credentials = header_field_credentials_l.to_string ();
request_params.correlation_id = header_corr_id_l.to_string ();
request_params.credentials = header_field_credentials_l;
request_params.correlation_id = header_corr_id_l;
request_params.path = boost::algorithm::erase_first_copy (path_l, api_path_l);
request_params.path = boost::algorithm::erase_first_copy (request_params.path, "/");
handler->process_request (request_params);