mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Replace std::shared_ptr<AsioTcpStream> with Shared<AsioTcpStream>::Ptr
This commit is contained in:
parent
a1683568a1
commit
26ce2cfb73
@ -86,7 +86,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::asio::buffered_stream<boost::asio::ip::tcp::socket> AsioTcpStream;
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +601,7 @@ OptionalTlsStream ElasticsearchWriter::Connect()
|
|||||||
stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
|
stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
|
stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -176,7 +176,7 @@ void GelfWriter::ReconnectInternal()
|
|||||||
m_Stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
|
m_Stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
m_Stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
|
m_Stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -187,7 +187,7 @@ void GraphiteWriter::ReconnectInternal()
|
|||||||
Log(LogNotice, "GraphiteWriter")
|
Log(LogNotice, "GraphiteWriter")
|
||||||
<< "Reconnecting to Graphite on host '" << GetHost() << "' port '" << GetPort() << "'.";
|
<< "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 {
|
try {
|
||||||
icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort());
|
icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort());
|
||||||
|
@ -37,7 +37,7 @@ protected:
|
|||||||
void Pause() override;
|
void Pause() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<AsioTcpStream> m_Stream;
|
Shared<AsioTcpStream>::Ptr m_Stream;
|
||||||
boost::mutex m_StreamMutex;
|
boost::mutex m_StreamMutex;
|
||||||
WorkQueue m_WorkQueue{10000000, 1};
|
WorkQueue m_WorkQueue{10000000, 1};
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ OptionalTlsStream InfluxdbWriter::Connect()
|
|||||||
stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
|
stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
|
stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -120,8 +120,7 @@ void OpenTsdbWriter::ReconnectTimerHandler()
|
|||||||
* We're using telnet as input method. Future PRs may change this into using the HTTP API.
|
* 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
|
* http://opentsdb.net/docs/build/html/user_guide/writing/index.html#telnet
|
||||||
*/
|
*/
|
||||||
|
m_Stream = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIoContext());
|
||||||
m_Stream = std::make_shared<AsioTcpStream>(IoEngine::Get().GetIoContext());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort());
|
icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort());
|
||||||
|
@ -32,7 +32,7 @@ protected:
|
|||||||
void Pause() override;
|
void Pause() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<AsioTcpStream> m_Stream;
|
Shared<AsioTcpStream>::Ptr m_Stream;
|
||||||
|
|
||||||
Timer::Ptr m_ReconnectTimer;
|
Timer::Ptr m_ReconnectTimer;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user