From 982274e834142bc8bea703076ae3eecb40f52baf Mon Sep 17 00:00:00 2001 From: laiwei Date: Thu, 23 Oct 2014 12:48:56 +0800 Subject: [PATCH] ping rrd-cached --- src/rrd_daemon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 4e9be7e8..f34d08af 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -295,6 +295,7 @@ static void journal_rotate(void); /* prototypes for forward refernces */ static int handle_request_help (HANDLER_PROTO); +static int handle_request_ping (HANDLER_PROTO); /* * Functions @@ -2366,6 +2367,14 @@ static command_t list_of_commands[] = { /* {{{ */ "HELP []\n", NULL, /* special! */ }, + { + "PING", + handle_request_ping, + CMD_CONTEXT_CLIENT, + "PING\n" + , + "PING given, PONG returned\n" + }, { "BATCH", batch_start, @@ -2605,6 +2614,11 @@ static int handle_request_help (HANDLER_PROTO) /* {{{ */ return send_response(sock, RESP_OK, resp_txt); } /* }}} int handle_request_help */ +static int handle_request_ping (HANDLER_PROTO) /* {{{ */ +{ + return send_response(sock, RESP_OK, "%s\n", "PONG"); +} /* }}} int handle_request_ping */ + static int handle_request (DISPATCH_PROTO) /* {{{ */ { char *buffer_ptr = buffer; -- 2.47.3