From: Alexander A. Klimov Date: Mon, 18 Feb 2019 14:31:58 +0000 (+0100) Subject: ApiListener: send icinga::Hello message X-Git-Tag: v2.11.0-rc1~174^2~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48b5824e37ee188bcef2d0f686445e5061f782c6;p=icinga2 ApiListener: send icinga::Hello message --- diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index b5fc8e18b..e0225aa10 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -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;