From: Alexander A. Klimov Date: Mon, 9 Sep 2019 11:10:12 +0000 (+0200) Subject: {HttpServer,JsonRpc}Connection#Disconnect(): cancel I/O ops ASAP X-Git-Tag: v2.11.0~1^2~9^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfaeb88ac3e347fd1588afe59dfc136e4a6d7de2;p=icinga2 {HttpServer,JsonRpc}Connection#Disconnect(): cancel I/O ops ASAP refs #7431 --- diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index 42adeda4c..aed0fd752 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -88,13 +88,13 @@ void HttpServerConnection::Disconnect() */ boost::system::error_code ec; - m_Stream->next_layer().async_shutdown(yc[ec]); - - m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec); + m_CheckLivenessTimer.cancel(); m_Stream->lowest_layer().cancel(ec); - m_CheckLivenessTimer.cancel(); + m_Stream->next_layer().async_shutdown(yc[ec]); + + m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec); auto listener (ApiListener::GetInstance()); diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp index e8279eac2..5a26812a2 100644 --- a/lib/remote/jsonrpcconnection.cpp +++ b/lib/remote/jsonrpcconnection.cpp @@ -224,14 +224,14 @@ void JsonRpcConnection::Disconnect() */ boost::system::error_code ec; - m_Stream->next_layer().async_shutdown(yc[ec]); - - m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec); + m_CheckLivenessTimer.cancel(); + m_HeartbeatTimer.cancel(); m_Stream->lowest_layer().cancel(ec); - m_CheckLivenessTimer.cancel(); - m_HeartbeatTimer.cancel(); + m_Stream->next_layer().async_shutdown(yc[ec]); + + m_Stream->lowest_layer().shutdown(m_Stream->lowest_layer().shutdown_both, ec); } }); }