]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
ping rrd-cached
authorlaiwei <laiwei.ustc@gmail.com>
Thu, 23 Oct 2014 04:48:56 +0000 (12:48 +0800)
committerlaiwei <laiwei.ustc@gmail.com>
Thu, 23 Oct 2014 04:48:56 +0000 (12:48 +0800)
src/rrd_daemon.c

index 4e9be7e8cbea1843075f7f5a42a7e8798f81692d..f34d08af1373496bc5ed8e26dec443d6274ed082 100644 (file)
@@ -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 [<command>]\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;