From 66bfda2e79574984ea47efea8a54630e65d84aa0 Mon Sep 17 00:00:00 2001 From: Jonathan Giszczak Date: Tue, 4 Feb 2020 16:54:55 -0500 Subject: [PATCH] Eliminate use of boost deprecated query object. The query object has been deprecated since boost 1.66. Incidentally resolves #5422 when using TCP on a system with only loopback configured. The preferred boost API no longer defaults to the address_configured flag. --- plugins/http_plugin/http_plugin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/http_plugin/http_plugin.cpp b/plugins/http_plugin/http_plugin.cpp index 2d6946d464..4337520ff8 100644 --- a/plugins/http_plugin/http_plugin.cpp +++ b/plugins/http_plugin/http_plugin.cpp @@ -735,9 +735,8 @@ class http_plugin_impl : public std::enable_shared_from_this { string lipstr = options.at( "http-server-address" ).as(); string host = lipstr.substr( 0, lipstr.find( ':' )); string port = lipstr.substr( host.size() + 1, lipstr.size()); - tcp::resolver::query query( tcp::v4(), host.c_str(), port.c_str()); try { - my->listen_endpoint = *resolver.resolve( query ); + my->listen_endpoint = *resolver.resolve( tcp::v4(), host, port ); ilog( "configured http to listen on ${h}:${p}", ("h", host)( "p", port )); } catch ( const boost::system::system_error& ec ) { elog( "failed to configure http to listen on ${h}:${p} (${m})", @@ -772,9 +771,8 @@ class http_plugin_impl : public std::enable_shared_from_this { string lipstr = options.at( "https-server-address" ).as(); string host = lipstr.substr( 0, lipstr.find( ':' )); string port = lipstr.substr( host.size() + 1, lipstr.size()); - tcp::resolver::query query( tcp::v4(), host.c_str(), port.c_str()); try { - my->https_listen_endpoint = *resolver.resolve( query ); + my->https_listen_endpoint = *resolver.resolve( tcp::v4(), host, port ); ilog( "configured https to listen on ${h}:${p} (TLS configuration will be validated momentarily)", ("h", host)( "p", port )); my->https_cert_chain = options.at( "https-certificate-chain-file" ).as();