From: laiwei Date: Thu, 23 Oct 2014 04:48:56 +0000 (+0800) Subject: ping rrd-cached X-Git-Tag: v1.5.0-rc1~18^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=982274e834142bc8bea703076ae3eecb40f52baf;p=thirdparty%2Frrdtool-1.x.git ping rrd-cached --- 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;