]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Graylog: Fix Asio resolve call
authorAdam Emerson <aemerson@redhat.com>
Thu, 12 Dec 2024 21:11:04 +0000 (16:11 -0500)
committerAdam Emerson <aemerson@redhat.com>
Mon, 10 Feb 2025 20:18:37 +0000 (15:18 -0500)
Signed-off-by: Adam Emerson <aemerson@redhat.com>
src/common/Graylog.cc

index 099acacd803b88b729e6e95c3caf8cf76bdb596d..e9c2565df62eb82ed361d7cc80989475d8aac9f9 100644 (file)
@@ -37,8 +37,7 @@ void Graylog::set_destination(const std::string& host, int port)
 {
   try {
     boost::asio::ip::udp::resolver resolver(m_io_service);
-    boost::asio::ip::udp::resolver::query query(host, std::to_string(port));
-    m_endpoint = *resolver.resolve(query);
+    m_endpoint = *resolver.resolve(host, std::to_string(port)).cbegin();
     m_log_dst_valid = true;
   } catch (boost::system::system_error const& e) {
     cerr << "Error resolving graylog destination: " << e.what() << std::endl;