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;
|
namespace asio = boost::asio;
|
||||||
|
|
||||||
auto& io (server->get_io_service());
|
auto& io (server->get_io_service());
|
||||||
auto sslConn (std::make_shared<AsioTlsStream>(io, *sslContext));
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
try {
|
try {
|
||||||
|
auto sslConn (std::make_shared<AsioTlsStream>(io, *sslContext));
|
||||||
|
|
||||||
server->async_accept(sslConn->lowest_layer(), yc);
|
server->async_accept(sslConn->lowest_layer(), yc);
|
||||||
} 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); });
|
asio::spawn(io, [this, sslConn](asio::yield_context yc) { NewClientHandler(yc, sslConn, String(), RoleServer); });
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
sslConn = std::make_shared<AsioTlsStream>(io, *sslContext);
|
Log(LogCritical, "ApiListener") << "Cannot accept new connection: " << DiagnosticInformation(ex, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue