Commit df346bca authored by antirez's avatar antirez
Browse files

ACL: ACLFreeUserAndKillClients(): free user later.

Soon or later we may have code in freeClient() that may have to deal
with ACLs. Imagine for instance the command proposed multiple times (not
sure if this will ever be accepted but still...):

    ONCLOSE DEL mykey

Accumulating commands to run when a client is disconnected. Now the
function is compatible with such use cases.

Related to #5829.
parent 2ce96c0f
...@@ -224,7 +224,6 @@ void ACLFreeUser(user *u) { ...@@ -224,7 +224,6 @@ void ACLFreeUser(user *u) {
* connections in order to kill all the pending ones that * connections in order to kill all the pending ones that
* are authenticated with such user. */ * are authenticated with such user. */
void ACLFreeUserAndKillClients(user *u) { void ACLFreeUserAndKillClients(user *u) {
ACLFreeUser(u);
listIter li; listIter li;
listNode *ln; listNode *ln;
listRewind(server.clients,&li); listRewind(server.clients,&li);
...@@ -242,6 +241,7 @@ void ACLFreeUserAndKillClients(user *u) { ...@@ -242,6 +241,7 @@ void ACLFreeUserAndKillClients(user *u) {
freeClientAsync(c); freeClientAsync(c);
} }
} }
ACLFreeUser(u);
} }
/* Copy the user ACL rules from the source user 'src' to the destination /* Copy the user ACL rules from the source user 'src' to the destination
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment