mirror of https://github.com/Icinga/icinga2.git
ApiListener#ListenerCoroutineProc(): catch more edge cases
This commit is contained in:
parent
a6813ec786
commit
e9a64abd09
|
@ -409,19 +409,17 @@ void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const std
|
|||
namespace asio = boost::asio;
|
||||
|
||||
auto& io (server->get_io_service());
|
||||
auto sslConn (std::make_shared<AsioTlsStream>(io, *sslContext));
|
||||
|
||||
for (;;) {
|
||||
try {
|
||||
auto sslConn (std::make_shared<AsioTlsStream>(io, *sslContext));
|
||||
|
||||
server->async_accept(sslConn->lowest_layer(), yc);
|
||||
|
||||
asio::spawn(io, [this, sslConn](asio::yield_context yc) { NewClientHandler(yc, sslConn, String(), RoleServer); });
|
||||
} catch (const std::exception& ex) {
|
||||
Log(LogCritical, "ApiListener") << "Cannot accept new connection: " << DiagnosticInformation(ex, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
asio::spawn(io, [this, sslConn](asio::yield_context yc) { NewClientHandler(yc, sslConn, String(), RoleServer); });
|
||||
|
||||
sslConn = std::make_shared<AsioTlsStream>(io, *sslContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue