]> granicus.if.org Git - icinga2/commitdiff
ApiListener: send icinga::Hello message
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Mon, 18 Feb 2019 14:31:58 +0000 (15:31 +0100)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Mon, 1 Apr 2019 09:40:14 +0000 (11:40 +0200)
lib/remote/apilistener.cpp

index b5fc8e18bf691fb90b6c5764689869e054563535..e0225aa107110732aaa0f8636f80bfd413b009df 100644 (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;