diff --git a/Builds/CMake/RippledCore.cmake b/Builds/CMake/RippledCore.cmake index 523fb77eb7..10a4a4fea2 100644 --- a/Builds/CMake/RippledCore.cmake +++ b/Builds/CMake/RippledCore.cmake @@ -128,6 +128,7 @@ target_include_directories (xrpl_core target_compile_definitions(xrpl_core PUBLIC + BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT HAS_UNCAUGHT_EXCEPTIONS=1) target_compile_options (xrpl_core PUBLIC diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index e8929305fd..9e8d58bc7e 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -360,7 +360,11 @@ OverlayImpl::makeRedirectResponse( msg.version(request.version()); msg.result(boost::beast::http::status::service_unavailable); msg.insert("Server", BuildInfo::getFullVersionString()); - msg.insert("Remote-Address", remote_address); + { + std::ostringstream ostr; + ostr << remote_address; + msg.insert("Remote-Address", ostr.str()); + } msg.insert("Content-Type", "application/json"); msg.insert(boost::beast::http::field::connection, "close"); msg.body() = Json::objectValue; diff --git a/src/ripple/server/impl/BaseWSPeer.h b/src/ripple/server/impl/BaseWSPeer.h index f634305497..b2ba7dd657 100644 --- a/src/ripple/server/impl/BaseWSPeer.h +++ b/src/ripple/server/impl/BaseWSPeer.h @@ -198,13 +198,14 @@ BaseWSPeer::run() impl().ws_.control_callback(control_callback_); start_timer(); close_on_timer_ = true; - impl().ws_.async_accept_ex( - request_, - [](auto& res) { + impl().ws_.set_option( + boost::beast::websocket::stream_base::decorator([](auto& res) { res.set( boost::beast::http::field::server, BuildInfo::getFullVersionString()); - }, + })); + impl().ws_.async_accept( + request_, bind_executor( strand_, std::bind( diff --git a/src/test/jtx/impl/JSONRPCClient.cpp b/src/test/jtx/impl/JSONRPCClient.cpp index cdf9ac9f7c..1e3664c60e 100644 --- a/src/test/jtx/impl/JSONRPCClient.cpp +++ b/src/test/jtx/impl/JSONRPCClient.cpp @@ -107,7 +107,11 @@ public: req.target("/"); req.version(11); req.insert("Content-Type", "application/json; charset=UTF-8"); - req.insert("Host", ep_); + { + std::ostringstream ostr; + ostr << ep_; + req.insert("Host", ostr.str()); + } { Json::Value jr; jr[jss::method] = cmd; diff --git a/src/test/jtx/impl/WSClient.cpp b/src/test/jtx/impl/WSClient.cpp index e4429d3c7c..8d8f6728e6 100644 --- a/src/test/jtx/impl/WSClient.cpp +++ b/src/test/jtx/impl/WSClient.cpp @@ -141,13 +141,14 @@ public: { auto const ep = getEndpoint(cfg, v2); stream_.connect(ep); - ws_.handshake_ex( - ep.address().to_string() + ":" + std::to_string(ep.port()), - "/", + ws_.set_option(boost::beast::websocket::stream_base::decorator( [&](boost::beast::websocket::request_type& req) { for (auto const& h : headers) req.set(h.first, h.second); - }); + })); + ws_.handshake( + ep.address().to_string() + ":" + std::to_string(ep.port()), + "/"); ws_.async_read( rb_, strand_.wrap(std::bind(