summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-06-26 18:34:57 +0200
committerantirez <antirez@gmail.com>2014-06-26 18:43:09 +0200
commit97f1fc65cf0331a367c2075c3adf09964dda2556 (patch)
tree0de6d8b1188675c2a19db57157173473435f68bf
parent42231117a735ebb24389435e8a636de02565c07f (diff)
downloadredis-97f1fc65cf0331a367c2075c3adf09964dda2556.tar.gz
CLIENT KILL: don't kill the master as a normal client.
Technically the problem is due to the client type API that does not return a special value for the master, however fixing it locally in the CLIENT KILL command is better currently because otherwise we would introduce a new output buffer limit class as a side effect.
-rw-r--r--src/networking.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/networking.c b/src/networking.c
index 7b6f46b34..0c2760504 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -1410,7 +1410,9 @@ void clientCommand(redisClient *c) {
while ((ln = listNext(&li)) != NULL) {
client = listNodeValue(ln);
if (addr && strcmp(getClientPeerId(client),addr) != 0) continue;
- if (type != -1 && getClientType(client) != type) continue;
+ if (type != -1 &&
+ (client->flags & REDIS_MASTER ||
+ getClientType(client) != type)) continue;
if (id != 0 && client->id != id) continue;
if (c == client && skipme) continue;