]> granicus.if.org Git - icinga2/commitdiff
Quality: Replace deprecated get_io_service() with get_executor().context() for Boost... 7210/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 29 May 2019 12:36:10 +0000 (14:36 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 29 May 2019 12:36:10 +0000 (14:36 +0200)
refs #7041

lib/base/tcpsocket.hpp
lib/remote/apilistener.cpp
lib/remote/httpserverconnection.cpp
lib/remote/jsonrpcconnection-heartbeat.cpp
lib/remote/jsonrpcconnection.cpp

index 0f8334f0130979a71c38ca929d2583a1279b9ea9..c0e7e803094023a8e1d47a02a946a650401ff1d3 100644 (file)
@@ -32,7 +32,7 @@ void Connect(Socket& socket, const String& node, const String& service)
 {
        using boost::asio::ip::tcp;
 
-       tcp::resolver resolver (socket.get_io_service());
+       tcp::resolver resolver (socket.get_executor().context());
        tcp::resolver::query query (node, service);
        auto result (resolver.resolve(query));
        auto current (result.begin());
@@ -61,7 +61,7 @@ void Connect(Socket& socket, const String& node, const String& service, boost::a
 {
        using boost::asio::ip::tcp;
 
-       tcp::resolver resolver (socket.get_io_service());
+       tcp::resolver resolver (socket.get_executor().context());
        tcp::resolver::query query (node, service);
        auto result (resolver.async_resolve(query, yc));
        auto current (result.begin());
index cfd207a31baf8f7f244f3d0211baf195580ec77e..4b18a162641afc60a27dcdfeb3918a8ce5dfefa6 100644 (file)
@@ -417,7 +417,7 @@ void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const std
 {
        namespace asio = boost::asio;
 
-       auto& io (server->get_io_service());
+       auto& io (server->get_executor().context());
 
        for (;;) {
                try {
@@ -641,7 +641,7 @@ void ApiListener::NewClientHandlerInternal(boost::asio::yield_context yc, const
 
                        endpoint->AddClient(aclient);
 
-                       asio::spawn(client->get_io_service(), [this, aclient, endpoint, needSync](asio::yield_context yc) {
+                       asio::spawn(client->get_executor().context(), [this, aclient, endpoint, needSync](asio::yield_context yc) {
                                CpuBoundWork syncClient (yc);
 
                                SyncClient(aclient, endpoint, needSync);
index 53aefc49735a7b96d885c14fd5fba90953938437..9d563af7604da056030ad4f70885f5e82dd624b5 100644 (file)
@@ -31,7 +31,7 @@ using namespace icinga;
 auto const l_ServerHeader ("Icinga/" + Application::GetAppVersion());
 
 HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const std::shared_ptr<AsioTlsStream>& stream)
-       : m_Stream(stream), m_Seen(Utility::GetTime()), m_IoStrand(stream->get_io_service()), m_ShuttingDown(false), m_HasStartedStreaming(false)
+       : m_Stream(stream), m_Seen(Utility::GetTime()), m_IoStrand(stream->get_executor().context()), m_ShuttingDown(false), m_HasStartedStreaming(false)
 {
        if (authenticated) {
                m_ApiUser = ApiUser::GetByClientCN(identity);
@@ -529,7 +529,7 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
 
 void HttpServerConnection::CheckLiveness(boost::asio::yield_context yc)
 {
-       boost::asio::deadline_timer timer (m_Stream->get_io_service());
+       boost::asio::deadline_timer timer (m_Stream->get_executor().context());
 
        for (;;) {
                timer.expires_from_now(boost::posix_time::seconds(5));
index f2e7f40453c88d3caa64219fcc54ed756a531d71..93f2a774c0bca8bb8f326e47514158b413da1fff 100644 (file)
@@ -17,7 +17,7 @@ REGISTER_APIFUNCTION(Heartbeat, event, &JsonRpcConnection::HeartbeatAPIHandler);
 
 void JsonRpcConnection::HandleAndWriteHeartbeats(boost::asio::yield_context yc)
 {
-       boost::asio::deadline_timer timer (m_Stream->get_io_service());
+       boost::asio::deadline_timer timer (m_Stream->get_executor().context());
 
        for (;;) {
                timer.expires_from_now(boost::posix_time::seconds(10));
index 1665f407f543db65870f1f78c318943853d3a0ec..251acbc0404344b329d4905a6e6cd8e5057912c7 100644 (file)
@@ -31,8 +31,8 @@ static RingBuffer l_TaskStats (15 * 60);
 JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
        const std::shared_ptr<AsioTlsStream>& stream, ConnectionRole role)
        : m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream),
-       m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_IoStrand(stream->get_io_service()),
-       m_OutgoingMessagesQueued(stream->get_io_service()), m_WriterDone(stream->get_io_service()), m_ShuttingDown(false)
+       m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_IoStrand(stream->get_executor().context()),
+       m_OutgoingMessagesQueued(stream->get_executor().context()), m_WriterDone(stream->get_executor().context()), m_ShuttingDown(false)
 {
        if (authenticated)
                m_Endpoint = Endpoint::GetByName(identity);
@@ -310,7 +310,7 @@ Value SetLogPositionHandler(const MessageOrigin::Ptr& origin, const Dictionary::
 
 void JsonRpcConnection::CheckLiveness(boost::asio::yield_context yc)
 {
-       boost::asio::deadline_timer timer (m_Stream->get_io_service());
+       boost::asio::deadline_timer timer (m_Stream->get_executor().context());
 
        for (;;) {
                timer.expires_from_now(boost::posix_time::seconds(30));