Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5103bb00
Commit
5103bb00
authored
Jun 27, 2018
by
antirez
Browse files
CLIENT ID implemented.
parent
bb666d44
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
5103bb00
...
@@ -1553,6 +1553,7 @@ void clientCommand(client *c) {
...
@@ -1553,6 +1553,7 @@ void clientCommand(client *c) {
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) {
if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"help")) {
const char *help[] = {
const char *help[] = {
"id -- Return the ID of the current connection.",
"getname -- Return the name of the current connection.",
"getname -- Return the name of the current connection.",
"kill <ip:port> -- Kill connection made from <ip:port>.",
"kill <ip:port> -- Kill connection made from <ip:port>.",
"kill <option> <value> [option value ...] -- Kill connections. Options are:",
"kill <option> <value> [option value ...] -- Kill connections. Options are:",
...
@@ -1566,6 +1567,9 @@ void clientCommand(client *c) {
...
@@ -1566,6 +1567,9 @@ void clientCommand(client *c) {
NULL
NULL
};
};
addReplyHelp(c, help);
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) {
} else if (!strcasecmp(c->argv[1]->ptr,"list") && c->argc == 2) {
/* CLIENT LIST */
/* CLIENT LIST */
sds o = getAllClientsInfoString();
sds o = getAllClientsInfoString();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment