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.
This commit is contained in:
Julian Brost 2024-11-13 17:18:28 +01:00
parent e6d103d0dd
commit a506d562ae
2 changed files with 5 additions and 0 deletions

View File

@ -102,6 +102,8 @@ static void DoIfwNetIo(
} }
{ {
// Using async_shutdown() instead of AsioTlsStream::GracefulDisconnect() as this whole function
// is already guarded by a timeout based on the check timeout.
boost::system::error_code ec; boost::system::error_code ec;
sslConn.async_shutdown(yc[ec]); sslConn.async_shutdown(yc[ec]);
} }

View File

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