Merge pull request #7747 from Icinga/bugfix/heartbeat-unauthenticated-7746

Don't send event::Heartbeat to unauthenticated peers
This commit is contained in:
Michael Friedrich 2020-02-06 14:32:25 +01:00 committed by GitHub
commit bf2d6abfad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -36,13 +36,15 @@ void JsonRpcConnection::HandleAndWriteHeartbeats(boost::asio::yield_context yc)
break;
}
SendMessageInternal(new Dictionary({
{ "jsonrpc", "2.0" },
{ "method", "event::Heartbeat" },
{ "params", new Dictionary({
{ "timeout", 120 }
}) }
}));
if (m_Endpoint) {
SendMessageInternal(new Dictionary({
{ "jsonrpc", "2.0" },
{ "method", "event::Heartbeat" },
{ "params", new Dictionary({
{ "timeout", 120 }
}) }
}));
}
}
}