From a1fef92835b4ceabe99f20818786eb84e1be5aeb Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" <alexander.klimov@icinga.com> Date: Thu, 25 Jul 2019 16:32:57 +0200 Subject: [PATCH] Replace std::shared_ptr<boost::asio::ip::tcp::acceptor> with Shared<boost::asio::ip::tcp::acceptor>::Ptr --- lib/remote/apilistener.cpp | 4 ++-- lib/remote/apilistener.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index a712376a9..1d49c63d2 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -364,7 +364,7 @@ bool ApiListener::AddListener(const String& node, const String& service) } auto& io (IoEngine::Get().GetIoContext()); - auto acceptor (std::make_shared<tcp::acceptor>(io)); + auto acceptor (Shared<tcp::acceptor>::Make(io)); try { tcp::resolver resolver (io); @@ -423,7 +423,7 @@ bool ApiListener::AddListener(const String& node, const String& service) return true; } -void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const std::shared_ptr<boost::asio::ip::tcp::acceptor>& server, const std::shared_ptr<boost::asio::ssl::context>& sslContext) +void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const Shared<boost::asio::ip::tcp::acceptor>::Ptr& server, const std::shared_ptr<boost::asio::ssl::context>& sslContext) { namespace asio = boost::asio; diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index cf5abe9e3..49116ca80 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -10,6 +10,7 @@ #include "remote/messageorigin.hpp" #include "base/configobject.hpp" #include "base/process.hpp" +#include "base/shared.hpp" #include "base/timer.hpp" #include "base/workqueue.hpp" #include "base/tcpsocket.hpp" @@ -152,7 +153,7 @@ private: void NewClientHandler(boost::asio::yield_context yc, const Shared<AsioTlsStream>::Ptr& client, const String& hostname, ConnectionRole role); void NewClientHandlerInternal(boost::asio::yield_context yc, const Shared<AsioTlsStream>::Ptr& client, const String& hostname, ConnectionRole role); - void ListenerCoroutineProc(boost::asio::yield_context yc, const std::shared_ptr<boost::asio::ip::tcp::acceptor>& server, const std::shared_ptr<boost::asio::ssl::context>& sslContext); + void ListenerCoroutineProc(boost::asio::yield_context yc, const Shared<boost::asio::ip::tcp::acceptor>::Ptr& server, const std::shared_ptr<boost::asio::ssl::context>& sslContext); WorkQueue m_RelayQueue; WorkQueue m_SyncQueue{0, 4}; -- 2.40.0