Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7e986363
Commit
7e986363
authored
Jun 16, 2014
by
antirez
Browse files
CLIENT KILL: fix closing link of the current client.
parent
ca262a58
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
7e986363
...
...
@@ -1357,6 +1357,7 @@ void clientCommand(redisClient *c) {
int type = -1;
uint64_t id = 0;
int killed = 0;
int close_this_client = 0;
/* Parse arguments. */
if (c->argc == 3) {
...
...
@@ -1396,7 +1397,7 @@ void clientCommand(redisClient *c) {
/* Kill it. */
if (c == client) {
cl
ient->flags |= REDIS_CLOSE_AFTER_REPLY
;
cl
ose_this_client = 1
;
} else {
freeClient(client);
}
...
...
@@ -1412,6 +1413,10 @@ void clientCommand(redisClient *c) {
} else {
addReplyLongLong(c,killed);
}
/* If this client has to be closed, flag it as CLOSE_AFTER_REPLY
* only after we queued the reply to its output buffers. */
if (close_this_client) c->flags |= REDIS_CLOSE_AFTER_REPLY;
} else if (!strcasecmp(c->argv[1]->ptr,"setname") && c->argc == 3) {
int j, len = sdslen(c->argv[2]->ptr);
char *p = c->argv[2]->ptr;
...
...
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