]> granicus.if.org Git - icinga2/commitdiff
Replace std::shared_ptr<AsioTcpStream> with Shared<AsioTcpStream>::Ptr
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Thu, 25 Jul 2019 12:55:22 +0000 (14:55 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 21 Oct 2019 14:12:46 +0000 (16:12 +0200)
lib/base/tlsstream.hpp
lib/perfdata/elasticsearchwriter.cpp
lib/perfdata/gelfwriter.cpp
lib/perfdata/graphitewriter.cpp
lib/perfdata/graphitewriter.hpp
lib/perfdata/influxdbwriter.cpp
lib/perfdata/opentsdbwriter.cpp
lib/perfdata/opentsdbwriter.hpp

index 1d81f77933ce4423c59e318441c76d15888cb3af..f78ec0ce68f2aae782feafea60bf984bed7996cb 100644 (file)
@@ -86,7 +86,7 @@ private:
 };
 
 typedef boost::asio::buffered_stream<boost::asio::ip::tcp::socket> AsioTcpStream;
-typedef std::pair<Shared<AsioTlsStream>::Ptr, std::shared_ptr<AsioTcpStream>> OptionalTlsStream;
+typedef std::pair<Shared<AsioTlsStream>::Ptr, Shared<AsioTcpStream>::Ptr> OptionalTlsStream;
 
 }
 
index a9d38d36f24366037753dda2c193bd94e8b009a1..9e9a919781752f8919dd6ae4407e60b2d563eca2 100644 (file)
@@ -601,7 +601,7 @@ OptionalTlsStream ElasticsearchWriter::Connect()
                stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
 
        } else {
-               stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
+               stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
        }
 
        try {
index 3094dd71fa95946bf414456fc501e47a9cbb619b..ed3b678c313d0004009ac9c111de6ff69331e900 100644 (file)
@@ -176,7 +176,7 @@ void GelfWriter::ReconnectInternal()
                m_Stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
 
        } else {
-               m_Stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
+               m_Stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
        }
 
        try {
index 642926f661a79d9759f04a302a86e371c3a61899..a1f5a19ec5330d0f410a9c63b921366af52c70b0 100644 (file)
@@ -187,7 +187,7 @@ void GraphiteWriter::ReconnectInternal()
        Log(LogNotice, "GraphiteWriter")
                << "Reconnecting to Graphite on host '" << GetHost() << "' port '" << GetPort() << "'.";
 
-       m_Stream = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
+       m_Stream = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
 
        try {
                icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort());
index 42f741cee3ba905ef8eb7c72cc079b2a5430749e..34118ab943cb6bfb0636dc85c10ee81b6afe82b9 100644 (file)
@@ -37,7 +37,7 @@ protected:
        void Pause() override;
 
 private:
-       std::shared_ptr<AsioTcpStream> m_Stream;
+       Shared<AsioTcpStream>::Ptr m_Stream;
        boost::mutex m_StreamMutex;
        WorkQueue m_WorkQueue{10000000, 1};
 
index 866dc25a04030c7080ac686cd9d5f60d5f1c8b0e..9036a79dcd487a387d045c0cd4ab9a18af82877c 100644 (file)
@@ -190,7 +190,7 @@ OptionalTlsStream InfluxdbWriter::Connect()
                stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
 
        } else {
-               stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
+               stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
        }
 
        try {
index b936b3083e3aebb7ea84d53679f6c30a478ed819..38405a2a3e8838f329248fa9fec95115b54e4f93 100644 (file)
@@ -120,8 +120,7 @@ void OpenTsdbWriter::ReconnectTimerHandler()
         * We're using telnet as input method. Future PRs may change this into using the HTTP API.
         * http://opentsdb.net/docs/build/html/user_guide/writing/index.html#telnet
         */
-
-       m_Stream = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
+       m_Stream = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
 
        try {
                icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort());
index bf0fc8eb197acafa2158142fbd81c1e054fbc222..5aff981cd928f0e687bc24c719253a720e72d6ff 100644 (file)
@@ -32,7 +32,7 @@ protected:
        void Pause() override;
 
 private:
-       std::shared_ptr<AsioTcpStream> m_Stream;
+       Shared<AsioTcpStream>::Ptr m_Stream;
 
        Timer::Ptr m_ReconnectTimer;