Skip to content

Commit 7430618

Browse files
committed
Add comment for remaining uses of async_shutdown() why it's safe
The reason for introducing AsioTlsStream::GracefulDisconnect() was to handle the TLS shutdown properly with a timeout since it involves a timeout. However, the implementation of this timeout involves spwaning coroutines which are redundant in some cases. This commit adds comments to the remaining calls of async_shutdown() stating why calling it is safe in these places.
1 parent be5151a commit 7430618

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/methods/ifwapichecktask.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ static void DoIfwNetIo(
102102
}
103103

104104
{
105+
// Using async_shutdown() instead of AsioTlsStream::GracefulDisconnect() as this whole function
106+
// is already guarded by a timeout based on the check timeout.
105107
boost::system::error_code ec;
106108
sslConn.async_shutdown(yc[ec]);
107109
}

lib/remote/apilistener.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,9 @@ void ApiListener::NewClientHandlerInternal(
719719
// Ignore the error, but do not throw an exception being swallowed at all cost.
720720
// https://github.com/Icinga/icinga2/issues/7351
721721
boost::system::error_code ec;
722+
723+
// Using async_shutdown() instead of AsioTlsStream::GracefulDisconnect() as this whole function
724+
// is already guarded by a timeout based on the connect timeout.
722725
sslConn.async_shutdown(yc[ec]);
723726
}
724727
});

0 commit comments

Comments
 (0)