From 4014dadf1e64a5caa4faaae0954c591c636d4ee0 Mon Sep 17 00:00:00 2001 From: Tim Ebbeke Date: Sun, 21 Dec 2025 02:37:08 +0100 Subject: [PATCH] Fixed compatibility with boost leaf 1.90.0 --- src/roar/server.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/roar/server.cpp b/src/roar/server.cpp index bdaf417d..8eed50de 100644 --- a/src/roar/server.cpp +++ b/src/roar/server.cpp @@ -109,8 +109,9 @@ namespace Roar //------------------------------------------------------------------------------------------------------------------ boost::leaf::result Server::start(unsigned short port, std::string const& host) { - return start(Dns::resolveSingle( - impl_->acceptor.get_executor(), host, port, false, boost::asio::ip::resolver_base::flags::passive)); + return start( + Dns::resolveSingle( + impl_->acceptor.get_executor(), host, port, false, boost::asio::ip::resolver_base::flags::passive)); } //------------------------------------------------------------------------------------------------------------------ boost::asio::ip::basic_endpoint const& Server::getLocalEndpoint() const @@ -120,25 +121,27 @@ namespace Roar //------------------------------------------------------------------------------------------------------------------ boost::leaf::result Server::start(boost::asio::ip::tcp::endpoint const& bindEndpoint) { + using namespace std::string_literals; + stop(); boost::system::error_code ec; impl_->bindEndpoint = bindEndpoint; impl_->acceptor.open(impl_->bindEndpoint.protocol(), ec); if (ec) - return boost::leaf::new_error("Could not open http server acceptor.", ec); + return boost::leaf::new_error("Could not open http server acceptor."s, ec); impl_->acceptor.set_option(boost::asio::socket_base::reuse_address(true), ec); if (ec) - return boost::leaf::new_error("Could not configure socket to reuse address.", ec); + return boost::leaf::new_error("Could not configure socket to reuse address."s, ec); impl_->acceptor.bind(impl_->bindEndpoint, ec); if (ec) - return boost::leaf::new_error("Could not bind socket.", ec); + return boost::leaf::new_error("Could not bind socket."s, ec); impl_->acceptor.listen(boost::asio::socket_base::max_listen_connections, ec); if (ec) - return boost::leaf::new_error("Could not listen on socket.", ec); + return boost::leaf::new_error("Could not listen on socket."s, ec); impl_->resolvedEndpoint = impl_->acceptor.local_endpoint(); impl_->acceptOnce(0);