aboutsummaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-15 09:54:31 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-15 09:54:31 +0200
commitffda2b39b6fe070a3f5edb229dd7806c362cc9e1 (patch)
treef9b389d4a15f32c761b8e718d2ae2853722d62db /command.c
parente11fe27b96ba5eeaae9abb04071888548e088c12 (diff)
server: Add cmd_ping
Diffstat (limited to 'command.c')
-rw-r--r--command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/command.c b/command.c
index 92556de..b966a75 100644
--- a/command.c
+++ b/command.c
@@ -258,6 +258,11 @@ static bool cmd_history(struct conn_data *data,const char *tag,const char **args
return closed;
}
+static bool cmd_ping(struct conn_data *data,const char *tag,const char **args){
+ (void)args;
+ return net_send_pong(data->fd,tag);
+}
+
struct cmd_info{
const char *cmdname;
@@ -275,6 +280,7 @@ static const struct cmd_info commands[]={
{"invite",2,false,cmd_invite},
{"send",2,true,cmd_send},
{"history",2,false,cmd_history},
+ {"ping",0,false,cmd_ping},
};
#define NCOMMANDS (sizeof(commands)/sizeof(commands[0]))