Replace std::shared_ptr<AsioTcpStream> with Shared<AsioTcpStream>::Ptr

This commit is contained in:
Alexander A. Klimov 2019-07-25 14:55:22 +02:00 committed by Michael Friedrich
parent a1683568a1
commit 26ce2cfb73
8 changed files with 8 additions and 9 deletions

View 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;
}

View 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 {

View 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 {

View 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());

View 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};

View 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 {

View 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());

View 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;