mirror of https://github.com/Icinga/icinga2.git
Don't call Timeout#Cancel() where Timeout#~Timeout() is called
This commit is contained in:
parent
959b162913
commit
d77d7506f1
|
@ -146,9 +146,6 @@ void AsioTlsStream::GracefulDisconnect(boost::asio::io_context::strand& strand,
|
|||
ForceDisconnect();
|
||||
}
|
||||
));
|
||||
Defer cancelTimeout ([&shutdownTimeout]() {
|
||||
shutdownTimeout->Cancel();
|
||||
});
|
||||
|
||||
// Close the TLS connection, effectively uses SSL_shutdown() to send a close_notify shutdown alert to the peer.
|
||||
boost::system::error_code ec;
|
||||
|
|
|
@ -318,7 +318,6 @@ void RedisConnection::Connect(asio::yield_context& yc)
|
|||
auto conn (Shared<AsioTlsStream>::Make(m_Strand.context(), *m_TLSContext, m_Host));
|
||||
auto& tlsConn (conn->next_layer());
|
||||
auto connectTimeout (MakeTimeout(conn));
|
||||
Defer cancelTimeout ([&connectTimeout]() { connectTimeout->Cancel(); });
|
||||
|
||||
icinga::Connect(conn->lowest_layer(), m_Host, Convert::ToString(m_Port), yc);
|
||||
tlsConn.async_handshake(tlsConn.client, yc);
|
||||
|
@ -348,7 +347,6 @@ void RedisConnection::Connect(asio::yield_context& yc)
|
|||
|
||||
auto conn (Shared<TcpConn>::Make(m_Strand.context()));
|
||||
auto connectTimeout (MakeTimeout(conn));
|
||||
Defer cancelTimeout ([&connectTimeout]() { connectTimeout->Cancel(); });
|
||||
|
||||
icinga::Connect(conn->next_layer(), m_Host, Convert::ToString(m_Port), yc);
|
||||
Handshake(conn, yc);
|
||||
|
@ -361,7 +359,6 @@ void RedisConnection::Connect(asio::yield_context& yc)
|
|||
|
||||
auto conn (Shared<UnixConn>::Make(m_Strand.context()));
|
||||
auto connectTimeout (MakeTimeout(conn));
|
||||
Defer cancelTimeout ([&connectTimeout]() { connectTimeout->Cancel(); });
|
||||
|
||||
conn->next_layer().async_connect(Unix::endpoint(m_Path.CStr()), yc);
|
||||
Handshake(conn, yc);
|
||||
|
|
|
@ -467,8 +467,6 @@ void IfwApiCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
|
|||
}
|
||||
);
|
||||
|
||||
Defer cancelTimeout ([&timeout]() { timeout->Cancel(); });
|
||||
|
||||
DoIfwNetIo(yc, cr, psCommand, psHost, expectedSan, psPort, *conn, *req);
|
||||
|
||||
cr->SetExecutionEnd(Utility::GetTime());
|
||||
|
|
|
@ -543,7 +543,6 @@ void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const Sha
|
|||
sslConn->lowest_layer().cancel(ec);
|
||||
}
|
||||
));
|
||||
Defer cancelTimeout([timeout]() { timeout->Cancel(); });
|
||||
|
||||
NewClientHandler(yc, strand, sslConn, String(), RoleServer);
|
||||
});
|
||||
|
@ -595,7 +594,6 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
|
|||
sslConn->lowest_layer().cancel(ec);
|
||||
}
|
||||
));
|
||||
Defer cancelTimeout([&timeout]() { timeout->Cancel(); });
|
||||
|
||||
Connect(sslConn->lowest_layer(), host, port, yc);
|
||||
|
||||
|
@ -693,8 +691,6 @@ void ApiListener::NewClientHandlerInternal(
|
|||
));
|
||||
|
||||
sslConn.async_handshake(role == RoleClient ? sslConn.client : sslConn.server, yc[ec]);
|
||||
|
||||
handshakeTimeout->Cancel();
|
||||
}
|
||||
|
||||
if (ec) {
|
||||
|
|
Loading…
Reference in New Issue