ApiListener: send icinga::Hello message

This commit is contained in:
Alexander A. Klimov 2019-02-18 15:31:58 +01:00
parent 49ac7777e0
commit 48b5824e37
1 changed files with 11 additions and 1 deletions

View File

@ -626,7 +626,17 @@ void ApiListener::NewClientHandlerInternal(boost::asio::yield_context yc, const
ClientType ctype;
if (role != RoleClient) {
if (role == RoleClient) {
JsonRpc::SendMessage(client, new Dictionary({
{ "jsonrpc", "2.0" },
{ "method", "icinga::Hello" },
{ "params", new Dictionary() }
}), yc);
client->async_flush(yc);
ctype = ClientJsonRpc;
} else {
{
boost::system::error_code ec;