]> granicus.if.org Git - icinga2/commitdiff
Replace std::shared_ptr<boost::asio::ip::tcp::acceptor> with Shared<boost::asio:...
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Thu, 25 Jul 2019 14:32:57 +0000 (16:32 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 21 Oct 2019 14:12:46 +0000 (16:12 +0200)
lib/remote/apilistener.cpp
lib/remote/apilistener.hpp

index a712376a9ba97fe3a89d41a91f150f5e62b6ba47..1d49c63d2f3c2d69a4968e6dc53b0383dbddb869 100644 (file)
@@ -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;
 
index cf5abe9e363e6a8dedc11fa2bac409e174ac94d2..49116ca80e70bcb2376aa686a66aac8b4e912758 100644 (file)
@@ -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};