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
61d9a73d
Commit
61d9a73d
authored
Jun 16, 2014
by
antirez
Browse files
CLIENT KILL: fix closing link of the current client.
parent
09dc6dad
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
61d9a73d
...
...
@@ -1330,6 +1330,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) {
...
...
@@ -1369,7 +1370,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);
}
...
...
@@ -1385,6 +1386,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