mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
While using Timeout, don't unnecessarily keep the strand alive via smart pointer
This commit is contained in:
parent
c23bd4c186
commit
d69291739f
@ -511,13 +511,11 @@ void RedisConnection::Handshake(StreamPtr& strm, boost::asio::yield_context& yc)
|
||||
template<class StreamPtr>
|
||||
Timeout::Ptr RedisConnection::MakeTimeout(StreamPtr& stream)
|
||||
{
|
||||
Ptr keepAlive (this);
|
||||
|
||||
return new Timeout(
|
||||
m_Strand.context(),
|
||||
m_Strand,
|
||||
boost::posix_time::microseconds(intmax_t(m_ConnectTimeout * 1000000)),
|
||||
[keepAlive, stream] {
|
||||
[stream] {
|
||||
boost::system::error_code ec;
|
||||
stream->lowest_layer().cancel(ec);
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ void ApiListener::NewClientHandlerInternal(
|
||||
strand->context(),
|
||||
*strand,
|
||||
boost::posix_time::microseconds(intmax_t(Configuration::TlsHandshakeTimeout * 1000000)),
|
||||
[strand, client] {
|
||||
[client] {
|
||||
boost::system::error_code ec;
|
||||
client->lowest_layer().cancel(ec);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user