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.
This commit is contained in:
antirez 2014-06-26 18:34:57 +02:00
parent 42231117a7
commit 97f1fc65cf

View File

@ -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;