mirror of
https://github.com/redis/redis.git
synced 2026-02-03 20:39:54 -05:00
Merge eb05ac4134 into b5a37c0e42
This commit is contained in:
commit
c26e9c1604
1 changed files with 9 additions and 2 deletions
11
src/server.c
11
src/server.c
|
|
@ -6897,8 +6897,15 @@ void monitorCommand(client *c) {
|
|||
return;
|
||||
}
|
||||
|
||||
/* ignore MONITOR if already slave or in monitor mode */
|
||||
if (c->flags & CLIENT_SLAVE) return;
|
||||
/* ignore MONITOR if already slave */
|
||||
if (c->flags & CLIENT_SLAVE) {
|
||||
if (c->flags & CLIENT_MONITOR) {
|
||||
addReplyError(c, "already monitoring");
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
c->flags |= (CLIENT_SLAVE|CLIENT_MONITOR);
|
||||
listAddNodeTail(server.monitors,c);
|
||||
|
|
|
|||
Loading…
Reference in a new issue