summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-06-27 13:11:50 +0200
committerantirez <antirez@gmail.com>2018-06-27 13:11:50 +0200
commit5103bb00d8466ded431dd31a0d41709475b1d11b (patch)
tree81b78acc8b78c5fa058442457471d0d373cc3f62
parentbb666d445d83287295832699d0b86d61866fedef (diff)
downloadredis-5103bb00d8466ded431dd31a0d41709475b1d11b.tar.gz
CLIENT ID implemented.
-rw-r--r--src/networking.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c
index 02e77307e..cfe23c6cc 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -1553,6 +1553,7 @@ void clientCommand(client *c) {
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) {
const char *help[] = {
+"id -- Return the ID of the current connection.",
"getname -- Return the name of the current connection.",
"kill <ip:port> -- Kill connection made from <ip:port>.",
"kill <option> <value> [option value ...] -- Kill connections. Options are:",
@@ -1566,6 +1567,9 @@ void clientCommand(client *c) {
NULL
};
addReplyHelp(c, help);
+ } else if (!strcasecmp(c->argv[1]->ptr,"id") && c->argc == 2) {
+ /* CLIENT ID */
+ addReplyLongLong(c,c->id);
} else if (!strcasecmp(c->argv[1]->ptr,"list") && c->argc == 2) {
/* CLIENT LIST */
sds o = getAllClientsInfoString();